forked from crosswalk-project/chromium-crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge M62] CronetEngine.Builder.setLibraryLoader not safe
Do not enforce ICronetEngineBuilder.setLibraryLoader() in Java and Native builder implementations by default. Instead introduce a new NativeCronetEngineBuilderWithLibraryLoaderImpl class that enforces the library loader. BUG=766248 (cherry picked from commit a9edc7a) Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester Change-Id: Ie78383084cd68b31f4a87463763891bd30368d21 Reviewed-on: https://chromium-review.googlesource.com/671416 Reviewed-by: Paul Jensen <[email protected]> Commit-Queue: Paul Jensen <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#502749} Reviewed-on: https://chromium-review.googlesource.com/676168 Cr-Commit-Position: refs/branch-heads/3202@{crosswalk-project#363} Cr-Branched-From: fa6a5d8-refs/heads/master@{#499098}
- Loading branch information
kapishnikov
committed
Sep 20, 2017
1 parent
a6c8266
commit f92b8c5
Showing
5 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ndroid/java/src/org/chromium/net/impl/NativeCronetEngineBuilderWithLibraryLoaderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.net.impl; | ||
|
||
import android.content.Context; | ||
|
||
import org.chromium.net.CronetEngine.Builder.LibraryLoader; | ||
import org.chromium.net.ICronetEngineBuilder; | ||
|
||
/** | ||
* An extension of {@link NativeCronetEngineBuilderImpl} that implements | ||
* {@link ICronetEngineBuilder#setLibraryLoader}. | ||
*/ | ||
public class NativeCronetEngineBuilderWithLibraryLoaderImpl extends NativeCronetEngineBuilderImpl { | ||
private VersionSafeCallbacks.LibraryLoader mLibraryLoader; | ||
|
||
/** | ||
* Constructs a builder for Native Cronet Engine. | ||
* Default config enables SPDY, disables QUIC, SDCH and HTTP cache. | ||
* | ||
* @param context Android {@link Context} for engine to use. | ||
*/ | ||
public NativeCronetEngineBuilderWithLibraryLoaderImpl(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
public CronetEngineBuilderImpl setLibraryLoader(LibraryLoader loader) { | ||
mLibraryLoader = new VersionSafeCallbacks.LibraryLoader(loader); | ||
return this; | ||
} | ||
|
||
@Override | ||
VersionSafeCallbacks.LibraryLoader libraryLoader() { | ||
return mLibraryLoader; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters