diff options
Diffstat (limited to 'chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java')
-rw-r--r-- | chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java index dc48b6e..5111105 100644 --- a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +++ b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java @@ -256,9 +256,10 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { "/system/framework/webview/paks"); // Make sure that ResourceProvider is initialized before starting the browser process. - setUpResources(mWebViewDelegate.getApplication()); + Context context = getWrappedCurrentApplicationContext(); + setUpResources(context); initPlatSupportLibrary(); - AwBrowserProcess.start(mWebViewDelegate.getApplication()); + AwBrowserProcess.start(context); if (isBuildDebuggable()) { setWebContentsDebuggingEnabled(true); @@ -295,6 +296,10 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { } } + private Context getWrappedCurrentApplicationContext() { + return ResourcesContextWrapperFactory.get(mWebViewDelegate.getApplication()); + } + AwBrowserContext getBrowserContext() { synchronized (mLock) { return getBrowserContextLocked(); @@ -426,7 +431,7 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { // will bring up just the parts it needs to make this work on a temporary // basis until Chromium is started for real. The temporary cookie manager // needs the application context to have been set. - ContentMain.initApplicationContext(mWebViewDelegate.getApplication()); + ContentMain.initApplicationContext(getWrappedCurrentApplicationContext()); } mCookieManager = new CookieManagerAdapter(new AwCookieManager()); } |