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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.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/omnibox/AutocompleteController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java
index 12ecd35ff03162d45aaf18738d8d58d586febec6..e5d294280733f2a87997285830c603b436746dc3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java
@@ -9,6 +9,7 @@ import android.text.TextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
+import org.chromium.chrome.browser.WarmupManager;
import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.MatchClassification;
import org.chromium.chrome.browser.omnibox.VoiceSuggestionProvider.VoiceResult;
import org.chromium.chrome.browser.profiles.Profile;
@@ -159,6 +160,11 @@ public class AutocompleteController {
public void startZeroSuggest(Profile profile, String omniboxText, String url,
boolean focusedFromFakebox) {
if (profile == null || TextUtils.isEmpty(url)) return;
+
+ // Proactively start up a renderer, to reduce the time to display search results,
+ // especially if a Service Worker is used.
+ WarmupManager.getInstance().createSpareRenderProcessHost(profile);
Ted C 2017/06/30 16:16:56 Is OmniboxPrerender fully disabled at this point?
mattcary 2017/07/03 08:03:02 It's 99% disabled, but that's a good point. Added
mattcary 2017/07/03 08:08:33 Actually, on further reflection, the spare rendere
+
mNativeAutocompleteControllerAndroid = nativeInit(profile);
if (mNativeAutocompleteControllerAndroid != 0) {
if (mUseCachedZeroSuggestResults) mWaitingForSuggestionsToCache = true;

Powered by Google App Engine
This is Rietveld 408576698