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 |
Charlie Reis
2017/06/25 23:48:27
What is createSpareWebContents used for? Do you t
mattcary
2017/06/26 14:45:05
It's unclear. The spare WebContents is used to spe
Charlie Reis
2017/06/26 21:22:49
Ok. Out of curiosity, what was the link you meant
mattcary
2017/06/28 13:14:38
Oops! https://docs.google.com/document/d/1rFx8QHH
Charlie Reis
2017/06/28 22:31:34
Agreed-- that seems like a good plan.
(Just to fo
mattcary
2017/06/29 12:57:09
I suspect so. Possibly createSpareWebContents will
|
+ * to fewer restrictions. |
+ * |
+ * This must be called from the UI thread. |
+ */ |
+ public void createSpareRenderProcessHost(Profile profile) { |
+ ThreadUtils.assertOnUiThread(); |
+ // 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); |
} |