Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1718)

Unified Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java

Issue 2645413002: Prepare to get the multiprocess setting from WebViewDelegate. (Closed)
Patch Set: Move version condition logic back to FactoryProvider Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
index 4c6da6f631b8b8ec4b163ea51380e6d73029f6a6..782747beda511a0162df9e26dec56cfe014887ae 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -50,6 +50,7 @@ import org.chromium.android_webview.HttpAuthDatabase;
import org.chromium.android_webview.PlatformServiceBridge;
import org.chromium.android_webview.ResourcesContextWrapperFactory;
import org.chromium.base.BuildConfig;
+import org.chromium.base.BuildInfo;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.MemoryPressureListener;
@@ -198,6 +199,13 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
initialize(WebViewDelegateFactory.createProxyDelegate(delegate));
}
+ /**
+ * Constructor for internal use when a proxy delegate has already been created.
+ */
+ WebViewChromiumFactoryProvider(WebViewDelegate delegate) {
+ initialize(delegate);
+ }
+
@SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME")
private void initialize(WebViewDelegate webViewDelegate) {
mWebViewDelegate = webViewDelegate;
@@ -225,9 +233,17 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
CommandLine.init(null);
}
- if (Settings.Global.getInt(ContextUtils.getApplicationContext().getContentResolver(),
- Settings.Global.WEBVIEW_MULTIPROCESS, 0)
- == 1) {
+ boolean multiProcess = false;
+ if (BuildInfo.isAtLeastO()) {
+ // Ask the system if multiprocess should be enabled on O+.
+ multiProcess = mWebViewDelegate.isMultiProcessEnabled();
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ // Check the multiprocess developer setting directly on N.
+ multiProcess = Settings.Global.getInt(
+ ContextUtils.getApplicationContext().getContentResolver(),
+ Settings.Global.WEBVIEW_MULTIPROCESS, 0) == 1;
+ }
+ if (multiProcess) {
CommandLine cl = CommandLine.getInstance();
cl.appendSwitch("webview-sandboxed-renderer");
}
« no previous file with comments | « no previous file | android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698