| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| index e57c64ad1b0866bef7ca97c4d6ab2fc86b569206..52b7b507b264840ddd4e67fbb1dc87b0993e37f5 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| @@ -30,8 +30,7 @@ public class WebApkActivity extends WebappActivity {
|
| /** Manages whether to check update for the WebAPK, and starts update check if needed. */
|
| private WebApkUpdateManager mUpdateManager;
|
|
|
| - private final ChildProcessCreationParams mDefaultParams =
|
| - ChildProcessCreationParams.getDefault();
|
| + private int mWebApkChildProcessCreationParamsId;
|
|
|
| @Override
|
| protected void onNewIntent(Intent intent) {
|
| @@ -118,6 +117,11 @@ public class WebApkActivity extends WebappActivity {
|
| Tab tab) {
|
| return new WebApkBrowserControlsDelegate(WebApkActivity.this, tab);
|
| }
|
| +
|
| + @Override
|
| + public int getChildProcessParamId() {
|
| + return WebApkActivity.this.mWebApkChildProcessCreationParamsId;
|
| + }
|
| };
|
| }
|
|
|
| @@ -151,20 +155,11 @@ public class WebApkActivity extends WebappActivity {
|
| }
|
|
|
| @Override
|
| - public void onResume() {
|
| - super.onResume();
|
| - // WebAPK hosts Chrome's renderer processes by declaring the Chrome's renderer service in
|
| - // its AndroidManifest.xml. We set {@link ChildProcessCreationParams} for WebAPK's renderer
|
| - // process so the {@link ChildProcessLauncher} knows which application's renderer
|
| - // service to connect.
|
| - initializeChildProcessCreationParams(true);
|
| - }
|
| -
|
| - @Override
|
| protected void initializeChildProcessCreationParams() {
|
| - // TODO(hanxi): crbug.com/611842. Investigates whether this function works for multiple
|
| - // windows or with --site-per-process enabled.
|
| - initializeChildProcessCreationParams(true);
|
| + boolean isExternalService = false;
|
| + mWebApkChildProcessCreationParamsId = ChildProcessCreationParams.register(
|
| + new ChildProcessCreationParams(getWebappInfo().webApkPackageName(),
|
| + isExternalService, LibraryProcessType.PROCESS_CHILD));
|
| }
|
|
|
| @Override
|
| @@ -176,29 +171,6 @@ public class WebApkActivity extends WebappActivity {
|
| }
|
|
|
| @Override
|
| - public void onPause() {
|
| - super.onPause();
|
| - initializeChildProcessCreationParams(false);
|
| - }
|
| -
|
| - /**
|
| - * Initializes {@link ChildProcessCreationParams} as a WebAPK's renderer process if
|
| - * {@link isForWebApk}} is true; as Chrome's child process otherwise.
|
| - * @param isForWebApk: Whether the {@link ChildProcessCreationParams} is initialized as a
|
| - * WebAPK renderer process.
|
| - */
|
| - private void initializeChildProcessCreationParams(boolean isForWebApk) {
|
| - // TODO(hanxi): crbug.com/664530. WebAPKs shouldn't use a global ChildProcessCreationParams.
|
| - ChildProcessCreationParams params = mDefaultParams;
|
| - if (isForWebApk) {
|
| - boolean isExternalService = false;
|
| - params = new ChildProcessCreationParams(getWebappInfo().webApkPackageName(),
|
| - isExternalService, LibraryProcessType.PROCESS_CHILD);
|
| - }
|
| - ChildProcessCreationParams.registerDefault(params);
|
| - }
|
| -
|
| - @Override
|
| protected void onDestroyInternal() {
|
| if (mUpdateManager != null) {
|
| mUpdateManager.destroy();
|
|
|