Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb65893a authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

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
parent 3897ad6e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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
+5 −1
Original line number Diff line number Diff line
@@ -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");
    }