Bug 1404144 - 4. Preload child process in geckoview_example in multiprocess mode; r=snorp
authorJim Chen <nchen@mozilla.com>
Wed, 04 Oct 2017 22:28:44 -0400
changeset 384606 1628829b6082eb457786146bd9caf7863b57fa89
parent 384605 dbfa1f3407f168d21f281ff7b1e49f5d625a1aa3
child 384607 9d197f1860e6151f28d10cec5b543d8ad99b7a64
push id32631
push userarchaeopteryx@coole-files.de
push dateThu, 05 Oct 2017 08:51:33 +0000
treeherdermozilla-central@66042a706980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1404144
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1404144 - 4. Preload child process in geckoview_example in multiprocess mode; r=snorp In geckoview_example multiprocess mode, preload child process during startup to make e10s startup faster. MozReview-Commit-ID: GinwBZlrnps
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -50,33 +50,37 @@ public class GeckoViewActivity extends A
         if (!TextUtils.isEmpty(intentArgs)) {
             if (geckoArgs == null) {
                 geckoArgs = intentArgs;
             } else {
                 geckoArgs += " " + intentArgs;
             }
         }
 
-        GeckoView.preload(this, geckoArgs);
+        final boolean useMultiprocess = getIntent().getBooleanExtra(USE_MULTIPROCESS_EXTRA,
+                                                                    true);
+        GeckoView.preload(this, geckoArgs, useMultiprocess);
 
         setContentView(R.layout.geckoview_activity);
 
         mGeckoView = (GeckoView) findViewById(R.id.gecko_view);
         mGeckoView.setContentListener(new MyGeckoViewContent());
         mGeckoView.setProgressListener(new MyGeckoViewProgress());
         mGeckoView.setNavigationListener(new Navigation());
 
         final BasicGeckoViewPrompt prompt = new BasicGeckoViewPrompt();
         prompt.filePickerRequestCode = REQUEST_FILE_PICKER;
         mGeckoView.setPromptDelegate(prompt);
 
         final MyGeckoViewPermission permission = new MyGeckoViewPermission();
         permission.androidPermissionRequestCode = REQUEST_PERMISSIONS;
         mGeckoView.setPermissionDelegate(permission);
 
+        mGeckoView.getSettings().setBoolean(GeckoViewSettings.USE_MULTIPROCESS,
+                                            useMultiprocess);
         loadSettings(getIntent());
         loadFromIntent(getIntent());
     }
 
     @Override
     protected void onNewIntent(final Intent intent) {
         super.onNewIntent(intent);
         setIntent(intent);
@@ -89,19 +93,16 @@ public class GeckoViewActivity extends A
 
     private void loadFromIntent(final Intent intent) {
         final Uri uri = intent.getData();
         mGeckoView.loadUri(uri != null ? uri.toString() : DEFAULT_URL);
     }
 
     private void loadSettings(final Intent intent) {
         mGeckoView.getSettings().setBoolean(
-            GeckoViewSettings.USE_MULTIPROCESS,
-            intent.getBooleanExtra(USE_MULTIPROCESS_EXTRA, true));
-        mGeckoView.getSettings().setBoolean(
             GeckoViewSettings.USE_REMOTE_DEBUGGER,
             intent.getBooleanExtra(USE_REMOTE_DEBUGGER_EXTRA, false));
     }
 
     @Override
     protected void onActivityResult(final int requestCode, final int resultCode,
                                     final Intent data) {
         if (requestCode == REQUEST_FILE_PICKER) {