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

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

Issue 2929113002: Enable spare RenderProcessHost to be preinitialized. (Closed)
Patch Set: rebase Created 3 years, 5 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..860795057b949d4ab9dd1acb83bbd0e01e0b4cd6 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,12 @@ public class AutocompleteController {
public void startZeroSuggest(Profile profile, String omniboxText, String url,
boolean focusedFromFakebox) {
if (profile == null || TextUtils.isEmpty(url)) return;
+
+ if (!focusedFromFakebox) {
Ted C 2017/07/11 16:21:46 I wonder if this should instead be NewTabPage.isNT
mattcary 2017/07/12 10:39:17 Done. I tested on a tablet, and using focusedFrom
+ // Proactively start up a renderer, to reduce the time to display search results,
+ // especially if a Service Worker is used.
+ WarmupManager.getInstance().createSpareRenderProcessHost(profile);
+ }
mNativeAutocompleteControllerAndroid = nativeInit(profile);
if (mNativeAutocompleteControllerAndroid != 0) {
if (mUseCachedZeroSuggestResults) mWaitingForSuggestionsToCache = true;
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698