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 scoring related experiments to control the topicality and scoring | |
| 274 // ranges of relevancy scores. | |
| 275 | |
| 276 // Returns true if HQP experimental scoring is enabled. Returns false if | |
| 277 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial. | |
| 278 static bool HQPExperimentalScoringEnabled(); | |
| 279 | |
| 280 // Returns the scoring buckets for HQP experiments. Returns empty string | |
| 281 // in case |kHQPExperimentalScoringBucketsParam| is specified in the field | |
|
Mark P
2015/02/18 00:03:32
This sentence is wrong in two ways:
(1) you meant
Ashok vardhan
2015/02/18 01:11:21
Done.
| |
| 282 // trial. Scoring buckets are stored in string form giving mapping from | |
| 283 // (topicality_score, frequency_score) to final relevance score. | |
| 284 // Please see GetRelevancyScore() under | |
| 285 // chrome/browser/history::ScoredHistoryMatch for details. | |
| 286 static std::string HQPExperimentalScoringBuckets(); | |
| 287 | |
| 288 // Returns the topicality threshold for HQP experiments. Returns -1 if | |
| 289 // |kHQPExperimentalScoringTopicalityThresholdParam| is not specified in the | |
| 290 // field trial. | |
| 291 static float HQPExperimentalTopicalityThreshold(); | |
| 292 | |
| 293 // --------------------------------------------------------- | |
| 273 // Exposed publicly for the sake of unittests. | 294 // Exposed publicly for the sake of unittests. |
| 274 static const char kBundledExperimentFieldTrialName[]; | 295 static const char kBundledExperimentFieldTrialName[]; |
| 275 // Rule names used by the bundled experiment. | 296 // Rule names used by the bundled experiment. |
| 276 static const char kDisableProvidersRule[]; | 297 static const char kDisableProvidersRule[]; |
| 277 static const char kShortcutsScoringMaxRelevanceRule[]; | 298 static const char kShortcutsScoringMaxRelevanceRule[]; |
| 278 static const char kSearchHistoryRule[]; | 299 static const char kSearchHistoryRule[]; |
| 279 static const char kDemoteByTypeRule[]; | 300 static const char kDemoteByTypeRule[]; |
| 280 static const char kHQPBookmarkValueRule[]; | 301 static const char kHQPBookmarkValueRule[]; |
| 281 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; | 302 static const char kHQPDiscountFrecencyWhenFewVisitsRule[]; |
| 282 static const char kHQPAllowMatchInTLDRule[]; | 303 static const char kHQPAllowMatchInTLDRule[]; |
| 283 static const char kHQPAllowMatchInSchemeRule[]; | 304 static const char kHQPAllowMatchInSchemeRule[]; |
| 284 static const char kZeroSuggestRule[]; | 305 static const char kZeroSuggestRule[]; |
| 285 static const char kZeroSuggestVariantRule[]; | 306 static const char kZeroSuggestVariantRule[]; |
| 286 static const char kAnswersInSuggestRule[]; | 307 static const char kAnswersInSuggestRule[]; |
| 287 static const char kDisplayHintTextWhenPossibleRule[]; | 308 static const char kDisplayHintTextWhenPossibleRule[]; |
| 288 static const char kDisableResultsCachingRule[]; | 309 static const char kDisableResultsCachingRule[]; |
| 289 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; | 310 static const char kMeasureSuggestPollingDelayFromLastKeystrokeRule[]; |
| 290 static const char kSuggestPollingDelayMsRule[]; | 311 static const char kSuggestPollingDelayMsRule[]; |
| 291 | 312 |
| 292 // Parameter names used by the HUP new scoring experiments. | 313 // Parameter names used by the HUP new scoring experiments. |
| 293 static const char kHUPNewScoringEnabledParam[]; | 314 static const char kHUPNewScoringEnabledParam[]; |
| 294 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; | 315 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; |
| 295 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; | 316 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; |
| 296 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; | 317 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; |
| 297 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; | 318 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; |
| 298 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; | 319 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; |
| 299 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; | 320 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; |
| 300 | 321 |
| 322 // Parameter names used by the HQP experimental scoring experiments. | |
| 323 static const char kHQPExperimentalScoringEnabledParam[]; | |
| 324 static const char kHQPExperimentalScoringBucketsParam[]; | |
| 325 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; | |
| 326 | |
| 301 // The amount of time to wait before sending a new suggest request after the | 327 // The amount of time to wait before sending a new suggest request after the |
| 302 // previous one unless overridden by a field trial parameter. | 328 // previous one unless overridden by a field trial parameter. |
| 303 // Non-const because some unittests modify this value. | 329 // Non-const because some unittests modify this value. |
| 304 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; | 330 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; |
| 305 | 331 |
| 306 private: | 332 private: |
| 307 friend class OmniboxFieldTrialTest; | 333 friend class OmniboxFieldTrialTest; |
| 308 | 334 |
| 309 // The bundled omnibox experiment comes with a set of parameters | 335 // The bundled omnibox experiment comes with a set of parameters |
| 310 // (key-value pairs). Each key indicates a certain rule that applies in | 336 // (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 | 348 // prioritize different wildcard contexts, see the implementation. How to |
| 323 // interpret the value is left to the caller; this is rule-dependent. | 349 // interpret the value is left to the caller; this is rule-dependent. |
| 324 static std::string GetValueForRuleInContext( | 350 static std::string GetValueForRuleInContext( |
| 325 const std::string& rule, | 351 const std::string& rule, |
| 326 metrics::OmniboxEventProto::PageClassification page_classification); | 352 metrics::OmniboxEventProto::PageClassification page_classification); |
| 327 | 353 |
| 328 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); | 354 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); |
| 329 }; | 355 }; |
| 330 | 356 |
| 331 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ | 357 #endif // COMPONENTS_OMNIBOX_OMNIBOX_FIELD_TRIAL_H_ |
| OLD | NEW |