Loading core/java/android/webkit/BrowserFrame.java +9 −6 Original line number Diff line number Diff line Loading @@ -105,10 +105,13 @@ class BrowserFrame extends Handler { */ public BrowserFrame(Context context, WebViewCore w, CallbackProxy proxy, WebSettings settings, Map<String, Object> javascriptInterfaces) { Context appContext = context.getApplicationContext(); // Create a global JWebCoreJavaBridge to handle timers and // cookies in the WebCore thread. if (sJavaBridge == null) { sJavaBridge = new JWebCoreJavaBridge(context); sJavaBridge = new JWebCoreJavaBridge(appContext); // set WebCore native cache size ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); Loading @@ -118,18 +121,18 @@ class BrowserFrame extends Handler { sJavaBridge.setCacheSize(4 * 1024 * 1024); } // initialize CacheManager CacheManager.init(context); CacheManager.init(appContext); // create CookieSyncManager with current Context CookieSyncManager.createInstance(context); CookieSyncManager.createInstance(appContext); // create PluginManager with current Context PluginManager.getInstance(context); PluginManager.getInstance(appContext); } mJSInterfaceMap = javascriptInterfaces; mSettings = settings; mContext = context; mCallbackProxy = proxy; mDatabase = WebViewDatabase.getInstance(context); mDatabase = WebViewDatabase.getInstance(appContext); mWebViewCore = w; AssetManager am = context.getAssets(); Loading Loading @@ -496,7 +499,7 @@ class BrowserFrame extends Handler { * @param uri A String representing the URI of the desired file. * @param buffer The byte array to copy the data into. * @param offset The offet into buffer to place the data. * @param expectSize The size that the buffer has allocated for this file. * @param expectedSize The size that the buffer has allocated for this file. * @return int The size of the given file, or zero if it fails. */ private int getFile(String uri, byte[] buffer, int offset, Loading core/java/android/webkit/CacheManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public final class CacheManager { * @param context The application context. */ static void init(Context context) { mDataBase = WebViewDatabase.getInstance(context); mDataBase = WebViewDatabase.getInstance(context.getApplicationContext()); mBaseDir = new File(context.getCacheDir(), "webviewCache"); if (createCacheDirectory() && mClearCacheOnInit) { removeAllCacheFiles(); Loading core/java/android/webkit/CookieSyncManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public final class CookieSyncManager extends WebSyncManager { public static synchronized CookieSyncManager createInstance( Context context) { if (sRef == null) { sRef = new CookieSyncManager(context); sRef = new CookieSyncManager(context.getApplicationContext()); } return sRef; } Loading core/java/android/webkit/PluginManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class PluginManager { throw new IllegalStateException( "First call to PluginManager need a valid context."); } mInstance = new PluginManager(context); mInstance = new PluginManager(context.getApplicationContext()); } return mInstance; } Loading core/java/android/webkit/WebView.java +1 −1 Original line number Diff line number Diff line Loading @@ -732,7 +732,7 @@ public class WebView extends AbsoluteLayout /** * Construct a new WebView with layout parameters, a default style and a set * of custom Javscript interfaces to be added to the WebView at initialization * time. This guraratees that these interfaces will be available when the JS * time. This guarantees that these interfaces will be available when the JS * context is initialized. * @param context A Context object used to access application assets. * @param attrs An AttributeSet passed to our parent. Loading Loading
core/java/android/webkit/BrowserFrame.java +9 −6 Original line number Diff line number Diff line Loading @@ -105,10 +105,13 @@ class BrowserFrame extends Handler { */ public BrowserFrame(Context context, WebViewCore w, CallbackProxy proxy, WebSettings settings, Map<String, Object> javascriptInterfaces) { Context appContext = context.getApplicationContext(); // Create a global JWebCoreJavaBridge to handle timers and // cookies in the WebCore thread. if (sJavaBridge == null) { sJavaBridge = new JWebCoreJavaBridge(context); sJavaBridge = new JWebCoreJavaBridge(appContext); // set WebCore native cache size ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); Loading @@ -118,18 +121,18 @@ class BrowserFrame extends Handler { sJavaBridge.setCacheSize(4 * 1024 * 1024); } // initialize CacheManager CacheManager.init(context); CacheManager.init(appContext); // create CookieSyncManager with current Context CookieSyncManager.createInstance(context); CookieSyncManager.createInstance(appContext); // create PluginManager with current Context PluginManager.getInstance(context); PluginManager.getInstance(appContext); } mJSInterfaceMap = javascriptInterfaces; mSettings = settings; mContext = context; mCallbackProxy = proxy; mDatabase = WebViewDatabase.getInstance(context); mDatabase = WebViewDatabase.getInstance(appContext); mWebViewCore = w; AssetManager am = context.getAssets(); Loading Loading @@ -496,7 +499,7 @@ class BrowserFrame extends Handler { * @param uri A String representing the URI of the desired file. * @param buffer The byte array to copy the data into. * @param offset The offet into buffer to place the data. * @param expectSize The size that the buffer has allocated for this file. * @param expectedSize The size that the buffer has allocated for this file. * @return int The size of the given file, or zero if it fails. */ private int getFile(String uri, byte[] buffer, int offset, Loading
core/java/android/webkit/CacheManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public final class CacheManager { * @param context The application context. */ static void init(Context context) { mDataBase = WebViewDatabase.getInstance(context); mDataBase = WebViewDatabase.getInstance(context.getApplicationContext()); mBaseDir = new File(context.getCacheDir(), "webviewCache"); if (createCacheDirectory() && mClearCacheOnInit) { removeAllCacheFiles(); Loading
core/java/android/webkit/CookieSyncManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public final class CookieSyncManager extends WebSyncManager { public static synchronized CookieSyncManager createInstance( Context context) { if (sRef == null) { sRef = new CookieSyncManager(context); sRef = new CookieSyncManager(context.getApplicationContext()); } return sRef; } Loading
core/java/android/webkit/PluginManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ public class PluginManager { throw new IllegalStateException( "First call to PluginManager need a valid context."); } mInstance = new PluginManager(context); mInstance = new PluginManager(context.getApplicationContext()); } return mInstance; } Loading
core/java/android/webkit/WebView.java +1 −1 Original line number Diff line number Diff line Loading @@ -732,7 +732,7 @@ public class WebView extends AbsoluteLayout /** * Construct a new WebView with layout parameters, a default style and a set * of custom Javscript interfaces to be added to the WebView at initialization * time. This guraratees that these interfaces will be available when the JS * time. This guarantees that these interfaces will be available when the JS * context is initialized. * @param context A Context object used to access application assets. * @param attrs An AttributeSet passed to our parent. Loading