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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.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
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 20c24c2d600a24530ff17f1fba9dbee275a23425..12e658bee619c6abd9f161af5d9551f39a7a8ac4 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -705,6 +705,15 @@ public class ContentViewCore
mWebContentsObserver = new WebContentsObserver(mWebContents) {
@Override
+ public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode,
+ String description, String failingUrl) {
+ // Navigation that fails the provisional load will have the strong binding removed
+ // here. One for which the provisional load is commited will have the strong binding
+ // removed in navigationEntryCommitted() below.
+ if (isProvisionalLoad) determinedProcessVisibility();
+ }
+
+ @Override
public void didNavigateMainFrame(String url, String baseUrl,
boolean isNavigationToDifferentPage, boolean isFragmentNavigation) {
if (!isNavigationToDifferentPage) return;
@@ -720,6 +729,19 @@ public class ContentViewCore
// No need to reset gesture detection as the detector will have
// been destroyed in the RenderWidgetHostView.
}
+
+ @Override
+ public void navigationEntryCommitted() {
+ determinedProcessVisibility();
+ }
+
+ private void determinedProcessVisibility() {
+ // Signal to the process management logic that we can now rely on the process
+ // visibility signal for binding management. Before the navigation commits, its
+ // renderer is considered background even if the pending navigation happens in the
+ // foreground renderer.
+ ChildProcessLauncher.determinedVisibility(getCurrentRenderProcessId());
+ }
};
}
@@ -1270,7 +1292,6 @@ public class ContentViewCore
* @return The ID of the renderer process that backs this tab or
* {@link #INVALID_RENDER_PROCESS_PID} if there is none.
*/
- @VisibleForTesting
public int getCurrentRenderProcessId() {
return nativeGetCurrentRenderProcessId(mNativeContentViewCore);
}

Powered by Google App Engine
This is Rietveld 408576698