| Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java
|
| index 3ff2afcf1edcdebb1e7d51a73194e7d4005398c2..d810afd8769e06992db363bbacc94e45eb8ab9f5 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java
|
| @@ -30,7 +30,7 @@ class ChildProcessLauncherHelper {
|
|
|
| // Note native pointer is only guaranteed live until nativeOnChildProcessStarted.
|
| private long mNativeChildProcessLauncherHelper;
|
| - private BaseChildProcessConnection mChildProcessConnection;
|
| + private ChildProcessConnection mChildProcessConnection;
|
|
|
| @CalledByNative
|
| private static FileDescriptorInfo makeFdInfo(
|
| @@ -66,7 +66,7 @@ class ChildProcessLauncherHelper {
|
| ChildProcessLauncher.start(ContextUtils.getApplicationContext(), paramId, commandLine,
|
| filesToBeMapped, new ChildProcessLauncher.LaunchCallback() {
|
| @Override
|
| - public void onChildProcessStarted(BaseChildProcessConnection connection) {
|
| + public void onChildProcessStarted(ChildProcessConnection connection) {
|
| mChildProcessConnection = connection;
|
| if (mNativeChildProcessLauncherHelper != 0) {
|
| nativeOnChildProcessStarted(
|
| @@ -91,15 +91,10 @@ class ChildProcessLauncherHelper {
|
| return false;
|
| }
|
|
|
| - if (mChildProcessConnection instanceof ImportantChildProcessConnection) {
|
| - // The connection was bound as BIND_IMPORTANT. This should prevent it from being killed
|
| - // when the app is on the foreground (that's our best guess, but there is no absolute
|
| - // guarantee).
|
| - return ChildProcessLauncher.isApplicationInForeground();
|
| - }
|
| -
|
| - return ((ManagedChildProcessConnection) mChildProcessConnection)
|
| - .isOomProtectedOrWasWhenDied();
|
| + // We consider the process to be child protected if it has a strong or moderate binding and
|
| + // the app is in the foreground.
|
| + return ChildProcessLauncher.isApplicationInForeground()
|
| + && !mChildProcessConnection.isWaivedBoundOnlyOrWasWhenDied();
|
| }
|
|
|
| @CalledByNative
|
|
|