Abstract ZygoteInit.maybePreload call for webview.
Make ZygoteConnection call ZygoteInit.maybePreload via an overridable method on itself, so that the WebView zygote's subclass of ZygoteConnection can override it to do nothing; the WebView zygote doesn't want to do this preloading and can't due to permissions. Test: enable multiprocess webview, test webview apps work Bug: 32735001 Change-Id: Ia6ac7d35172ba69ff861fe5a44b09ac52b0afbf0
This commit is contained in:
@@ -53,6 +53,11 @@ class WebViewZygoteInit {
|
||||
super(socket, abiList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void maybePreload() {
|
||||
// Do nothing, we don't need to call ZygoteInit.maybePreload() for the WebView zygote.
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean handlePreloadPackage(String packagePath, String libsPath) {
|
||||
// Ask ApplicationLoaders to create and cache a classloader for the WebView APK so that
|
||||
|
||||
@@ -171,7 +171,7 @@ class ZygoteConnection {
|
||||
return handleAbiListQuery();
|
||||
}
|
||||
|
||||
ZygoteInit.maybePreload();
|
||||
maybePreload();
|
||||
|
||||
if (parsedArgs.preloadPackage != null) {
|
||||
return handlePreloadPackage(parsedArgs.preloadPackage,
|
||||
@@ -279,6 +279,10 @@ class ZygoteConnection {
|
||||
}
|
||||
}
|
||||
|
||||
protected void maybePreload() {
|
||||
ZygoteInit.maybePreload();
|
||||
}
|
||||
|
||||
protected boolean handlePreloadPackage(String packagePath, String libsPath) {
|
||||
throw new RuntimeException("Zyogte does not support package preloading");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user