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

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

Issue 673573003: Android: remove the initial binding when the renderer commits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a Java checkstyle warning. Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/BindingManagerImpl.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/BindingManager.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/BindingManager.java b/content/public/android/java/src/org/chromium/content/browser/BindingManager.java
index 01e0bfabb1506dcb6a7a631dc961a9477339a09f..c080895d9ba158d4585e187b6ad7dcc75cbb40de 100644
--- a/content/public/android/java/src/org/chromium/content/browser/BindingManager.java
+++ b/content/public/android/java/src/org/chromium/content/browser/BindingManager.java
@@ -10,13 +10,14 @@ package org.chromium.content.browser;
* normal conditions (it can still be killed under drastic memory pressure). ChildProcessConnections
* have two oom bindings: initial binding and strong binding.
*
- * BindingManager receives calls that signal visibility of each service (setInForeground()) and the
- * entire embedding application (onSentToBackground(), onBroughtToForeground()) and manipulates
- * child process bindings accordingly.
+ * BindingManager receives calls that signal status of each service (setInForeground(),
+ * determinedVisibility()) and the entire embedding application (onSentToBackground(),
+ * onBroughtToForeground()) and manipulates child process bindings accordingly.
*
* In particular, BindingManager is responsible for:
- * - removing the initial binding of a service when its visibility is determined for the first time
- * - addition and (possibly delayed) removal of a strong binding when service visibility changes
+ * - adding and removing the strong binding as service visibility changes (setInForeground())
+ * - removing the initial binding of a service when we can start to rely on the visibility signal /
+ * strong binding exclusively (after determinedVisibility())
* - dropping the current oom bindings when a new connection is started on a low-memory device
* - keeping a strong binding on the foreground service while the entire application is in
* background
@@ -42,6 +43,13 @@ public interface BindingManager {
void setInForeground(int pid, boolean inForeground);
/**
+ * Called when we can begin to rely on the visibility signal only and remove the initial
+ * binding. It's safe to call it multiple times, only the first call matters.
+ * @param pid handle of the service process
+ */
+ void determinedVisibility(int pid);
+
+ /**
* Called when the embedding application is sent to background. We want to maintain a strong
* binding on the most recently used renderer while the embedder is in background, to indicate
* the relative importance of the renderer to system oom killer.
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/BindingManagerImpl.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698