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

Unified Diff: components/omnibox/browser/omnibox_field_trial.cc

Issue 2864103003: Limit the number of history urls indexed for omnibox suggestions. (Closed)
Patch Set: address comments. Created 3 years, 7 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: components/omnibox/browser/omnibox_field_trial.cc
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
index 378027ff0bc2748b7e25fac1086ed2b30034d053..b575b5165010a97f6cb1ab8fcfe83a7189db8294 100644
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -631,6 +631,17 @@ int OmniboxFieldTrial::GetPhysicalWebAfterTypingBaseRelevance() {
return 700;
}
+// static
+int OmniboxFieldTrial::MaxNumHQPUrlsIndexedAtStartup() {
Mark P 2017/05/10 17:23:09 nit: .cc function order should match .h order (I
ssid 2017/05/10 19:47:58 Sorry. I actually forgot to move this.
+ std::string param_value(variations::GetVariationParamValue(
+ kBundledExperimentFieldTrialName, kMaxNumHQPUrlsIndexedAtStartupParam));
+ int num_urls;
+ if (!param_value.empty() && base::StringToInt(param_value, &num_urls))
sdefresne 2017/05/10 08:59:41 nit: base::StringToInt returns false for empty str
ssid 2017/05/10 19:47:58 Done. Also some other functions have similar check
+ return num_urls;
+ // Default value is set to -1 for unlimited number of urls.
+ return -1;
+}
+
// static
bool OmniboxFieldTrial::InZeroSuggestRedirectToChromeFieldTrial() {
return base::FeatureList::IsEnabled(omnibox::kZeroSuggestRedirectToChrome);
@@ -726,6 +737,9 @@ const char OmniboxFieldTrial::kPhysicalWebZeroSuggestBaseRelevanceParam[] =
const char OmniboxFieldTrial::kPhysicalWebAfterTypingBaseRelevanceParam[] =
"PhysicalWebAfterTypingBaseRelevanceParam";
+const char OmniboxFieldTrial::kMaxNumHQPUrlsIndexedAtStartupParam[] =
+ "MaxNumHQPUrlsIndexedAtStartup";
+
const char OmniboxFieldTrial::kZeroSuggestRedirectToChromeServerAddressParam[] =
"ZeroSuggestRedirectToChromeServerAddress";
const char

Powered by Google App Engine
This is Rietveld 408576698