Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1996)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java

Issue 2874643002: Merging Managed and Important connection. (Closed)
Patch Set: Fix test + sync Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698