Remove WebView library preloading mechanism.

We don't want to preload the WebView library in the zygote process any
more, as loading an updatable WebView in the zygote is a stability risk.
The memory benefits of preloading will be obtained in other ways.

Bug: 13005501
Change-Id: Ic89f2a1d057dc92b01fb775bf326b47ac2d4caa2
This commit is contained in:
Torne (Richard Coles)
2014-05-02 15:21:54 +01:00
parent 969265af31
commit b5de924fad
2 changed files with 0 additions and 21 deletions

View File

@@ -37,17 +37,6 @@ public final class WebViewFactory {
private static final boolean DEBUG = false;
private static class Preloader {
static WebViewFactoryProvider sPreloadedProvider;
static {
try {
sPreloadedProvider = getFactoryClass().newInstance();
} catch (Exception e) {
Log.w(LOGTAG, "error preloading provider", e);
}
}
}
// Cache the factory both for efficiency, and ensure any one process gets all webviews from the
// same provider.
private static WebViewFactoryProvider sProviderInstance;
@@ -67,15 +56,6 @@ public final class WebViewFactory {
throw new AndroidRuntimeException(e);
}
// This implicitly loads Preloader even if it wasn't preloaded at boot.
if (Preloader.sPreloadedProvider != null &&
Preloader.sPreloadedProvider.getClass() == providerClass) {
sProviderInstance = Preloader.sPreloadedProvider;
if (DEBUG) Log.v(LOGTAG, "Using preloaded provider: " + sProviderInstance);
return sProviderInstance;
}
// The preloaded provider isn't the one we wanted; construct our own.
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
sProviderInstance = providerClass.newInstance();

View File

@@ -1208,7 +1208,6 @@ android.webkit.WebView$PrivateAccess
android.webkit.WebViewClient
android.webkit.WebViewDatabase
android.webkit.WebViewFactory
android.webkit.WebViewFactory$Preloader
android.webkit.WebViewFactoryProvider
android.webkit.WebViewFactoryProvider$Statics
android.webkit.WebViewProvider