Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
| 6 #define COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 6 #define COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 | 263 |
| 264 // Returns true if the search provider should not be caching results. | 264 // Returns true if the search provider should not be caching results. |
| 265 static bool DisableResultsCaching(); | 265 static bool DisableResultsCaching(); |
| 266 | 266 |
| 267 // Returns how the search provider should poll Suggest. Currently, we support | 267 // Returns how the search provider should poll Suggest. Currently, we support |
| 268 // measuring polling delay from the last keystroke or last suggest request. | 268 // measuring polling delay from the last keystroke or last suggest request. |
| 269 static void GetSuggestPollingStrategy(bool* from_last_keystroke, | 269 static void GetSuggestPollingStrategy(bool* from_last_keystroke, |
| 270 int* polling_delay_ms); | 270 int* polling_delay_ms); |
| 271 | 271 |
| 272 // --------------------------------------------------------- | 272 // --------------------------------------------------------- |
| 273 // For HQP related experiments. | |
|
Mark P
2015/02/11 21:57:30
please make this comment clearer about what this s
Ashok vardhan
2015/02/12 19:56:32
Done.
| |
| 274 // | |
|
Mark P
2015/02/11 21:57:30
nit: want a blank line without a // here, like all
Ashok vardhan
2015/02/12 19:56:32
Done.
| |
| 275 // Returns true if the HQP experimenal scoring is enabled. | |
|
Mark P
2015/02/11 21:57:30
spelling mistake, plus omit "the"
Ashok vardhan
2015/02/12 19:56:32
Done.
| |
| 276 static bool HQPExperimentalScoringEnabled(); | |
| 277 | |
| 278 // Returns the scoring buckets for HQP experiments. Returns empty string | |
| 279 // incase not initialized. | |
|
Mark P
2015/02/11 21:57:30
1. "in case" is two words.
2. in case what is not
Ashok vardhan
2015/02/12 19:56:32
I dont want to return the special string if the ex
| |
| 280 static std::string HQPExperimentalScoringBuckets(); | |
| 281 | |
| 282 // Returns the topicality threshold for HQP experiments. If it is not | |
| 283 // initialized return -1. | |
|
Mark P
2015/02/11 21:57:30
again, I think you mean:
it -> the parameter
initi
Ashok vardhan
2015/02/12 19:56:31
Done.
| |
| 284 static float HQPExperimentalTopicalityThreshold(); | |
| 285 | |
| 286 // --------------------------------------------------------- | |
| 273 // Exposed publicly for the sake of unittests. | 287 // Exposed publicly for the sake of unittests. |
| 274 static const char kBundledExperimentFieldTrialName[]; | 288 static const char kBundledExperimentFieldTrialName[]; |
| 275 // Rule names used by the bundled experiment. | 289 // Rule names used by the bundled experiment. |
| 276 static const char kDisableProvidersRule[]; | 290 static const char kDisableProvidersRule[]; |
| 277 static const char kShortcutsScoringMaxRelevanceRule[]; | 291 static const char kShortcutsScoringMaxRelevanceRule[]; |
| 278 static const char kSearchHistoryRule[]; | 292 static const char kSearchHistoryRule[]; |
| 279 static const char kDemoteByTypeRule[]; | 293 static const char kDemoteByTypeRule[]; |
| 280 static const char kHQPBookmarkValueRule[]; | 294 static const char kHQPBookmarkValueRule[]; |
| 281 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 295 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
| 282 static const char kHQPAllowMatchInTLDRule[]; | 296 static const char kHQPAllowMatchInTLDRule[]; |
| 283 static const char kHQPAllowMatchInSchemeRule[]; | 297 static const char kHQPAllowMatchInSchemeRule[]; |
| 284 static const char kZeroSuggestRule[]; | 298 static const char kZeroSuggestRule[]; |
| 285 static const char kZeroSuggestVariantRule[]; | 299 static const char kZeroSuggestVariantRule[]; |
| 286 static const char kAnswersInSuggestRule[]; | 300 static const char kAnswersInSuggestRule[]; |
| 287 static const char kDisplayHintTextWhenPossibleRule[]; | 301 static const char kDisplayHintTextWhenPossibleRule[]; |
| 288 static const char kDisableResultsCachingRule[]; | 302 static const char kDisableResultsCachingRule[]; |
| 289 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; | 303 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; |
| 290 static const char kSuggestPollingDelayMsRule[]; | 304 static const char kSuggestPollingDelayMsRule[]; |
| 291 | 305 |
| 292 // Parameter names used by the HUP new scoring experiments. | 306 // Parameter names used by the HUP new scoring experiments. |
| 293 static const char kHUPNewScoringEnabledParam[]; | 307 static const char kHUPNewScoringEnabledParam[]; |
| 294 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 308 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
| 295 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 309 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
| 296 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 310 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
| 297 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 311 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
| 298 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 312 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
| 299 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 313 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
| 300 | 314 |
| 315 // Parameter names used by the HQP scoring experiments. | |
|
Mark P
2015/02/11 21:57:30
insert "experimental", as you're going to do in th
Ashok vardhan
2015/02/12 19:56:32
Done.
| |
| 316 static const char kHQPExperimentalScoringEnabledParam[]; | |
| 317 static const char kHQPExperimentalScoringBucketsParam[]; | |
| 318 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; | |
| 319 | |
| 301 // The amount of time to wait before sending a new suggest request after the | 320 // The amount of time to wait before sending a new suggest request after the |
| 302 // previous one unless overridden by a field trial parameter. | 321 // previous one unless overridden by a field trial parameter. |
| 303 // Non-const because some unittests modify this value. | 322 // Non-const because some unittests modify this value. |
| 304 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; | 323 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; |
| 305 | 324 |
| 306 private: | 325 private: |
| 307 friend class OmniboxFieldTrialTest; | 326 friend class OmniboxFieldTrialTest; |
| 308 | 327 |
| 309 // The bundled omnibox experiment comes with a set of parameters | 328 // The bundled omnibox experiment comes with a set of parameters |
| 310 // (key-value pairs). Each key indicates a certain rule that applies in | 329 // (key-value pairs). Each key indicates a certain rule that applies in |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 322 // prioritize different wildcard contexts, see the implementation. How to | 341 // prioritize different wildcard contexts, see the implementation. How to |
| 323 // interpret the value is left to the caller; this is rule-dependent. | 342 // interpret the value is left to the caller; this is rule-dependent. |
| 324 static std::string GetValueForRuleInContext( | 343 static std::string GetValueForRuleInContext( |
| 325 const std::string& rule, | 344 const std::string& rule, |
| 326 metrics::OmniboxEventProto::PageClassification page_classification); | 345 metrics::OmniboxEventProto::PageClassification page_classification); |
| 327 | 346 |
| 328 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 347 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 329 }; | 348 }; |
| 330 | 349 |
| 331 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 350 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |