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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java

Issue 2929113002: Enable spare RenderProcessHost to be preinitialized. (Closed)
Patch Set: added comments Created 3 years, 6 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: chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
index 7c6ccb38bc737891664f5ace3b09ebee4922aeba..ab0bfccabc8f7b46487b628b59e457c72000ff1f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
@@ -248,6 +248,25 @@ public final class WarmupManager {
}
}
+ /**
+ * Warms up a spare, empty RenderProcessHost that may be used for subsequent navigations.
+ *
+ * The spare RenderProcessHost will be used automatically in subsequent navigations.
+ * There is nothing further the WarmupManager needs to do to enable that use.
+ *
+ * This uses a different mechanism than createSpareWebContents, below, and is subject
+ * to fewer restrictions.
+ *
+ * This must be called from the UI thread.
+ */
+ public void createSpareRenderProcessHost(Profile profile) {
+ ThreadUtils.assertOnUiThread();
Ted C 2017/06/30 16:16:56 should we be excluding low end devices here? i.e.
mattcary 2017/07/03 08:03:02 We manage the logic on when to create a spare rend
Ted C 2017/07/05 03:54:05 I looked at that as well, and I'm not seeing where
+ // Spare WebContents should not be used with spare RenderProcessHosts, but if one
+ // has been created, destroy it in order not to consume too many processes.
+ destroySpareWebContents();
+ nativeWarmupSpareRenderer(profile);
+ }
+
/**
* Creates and initializes a spare WebContents, to be used in a subsequent navigation.
*
@@ -314,4 +333,5 @@ public final class WarmupManager {
}
private static native void nativePreconnectUrlAndSubresources(Profile profile, String url);
+ private static native void nativeWarmupSpareRenderer(Profile profile);
}

Powered by Google App Engine
This is Rietveld 408576698