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

Side by Side Diff: components/omnibox/browser/omnibox_field_trial.h

Issue 2548363010: Omnibox - Refactor |relevance_buckets| to Remove Memory Leak on Exit (Closed)
Patch Set: 0.8 -> 0.8f Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/omnibox/browser/omnibox_field_trial.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BROWSER_OMNIBOX_FIELD_TRIAL_H_ 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_
6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // Returns how the search provider should poll Suggest. Currently, we support 264 // Returns how the search provider should poll Suggest. Currently, we support
265 // measuring polling delay from the last keystroke or last suggest request. 265 // measuring polling delay from the last keystroke or last suggest request.
266 static void GetSuggestPollingStrategy(bool* from_last_keystroke, 266 static void GetSuggestPollingStrategy(bool* from_last_keystroke,
267 int* polling_delay_ms); 267 int* polling_delay_ms);
268 268
269 // --------------------------------------------------------- 269 // ---------------------------------------------------------
270 // For HQP scoring related experiments to control the topicality and scoring 270 // For HQP scoring related experiments to control the topicality and scoring
271 // ranges of relevancy scores. 271 // ranges of relevancy scores.
272 272
273 // Returns true if HQP experimental scoring is enabled. Returns false if 273 // Returns the scoring buckets for HQP experiments. Returns an empty string
274 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial. 274 // if scoring buckets are not specified in the field trial. Scoring buckets
275 static bool HQPExperimentalScoringEnabled(); 275 // are stored in string form giving mapping from (topicality_score,
276 276 // frequency_score) to final relevance score. Please see GetRelevancyScore()
277 // Returns the scoring buckets for HQP experiments. Returns empty string 277 // under chrome/browser/history::ScoredHistoryMatch for details.
278 // in case |kHQPExperimentalScoringBucketsParam| or
279 // |kHQPExperimentalScoringEnabledParam| is not specified in the
280 // field trial. Scoring buckets are stored in string form giving mapping from
281 // (topicality_score, frequency_score) to final relevance score.
282 // Please see GetRelevancyScore() under
283 // chrome/browser/history::ScoredHistoryMatch for details.
284 static std::string HQPExperimentalScoringBuckets(); 278 static std::string HQPExperimentalScoringBuckets();
285 279
286 // Returns the topicality threshold for HQP experiments. Returns -1 if 280 // Returns the topicality threshold for HQP experiments. Returns a default
287 // |kHQPExperimentalScoringTopicalityThresholdParam| or 281 // value of 0.8 if no threshold is specified in the field trial.
288 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial.
289 static float HQPExperimentalTopicalityThreshold(); 282 static float HQPExperimentalTopicalityThreshold();
290 283
291 // --------------------------------------------------------- 284 // ---------------------------------------------------------
292 // For the HQPFixFrequencyScoring experiment that's part of the 285 // For the HQPFixFrequencyScoring experiment that's part of the
293 // bundled omnibox field trial. 286 // bundled omnibox field trial.
294 287
295 // Returns true if HQP should apply the bug fix to discount the visits to 288 // Returns true if HQP should apply the bug fix to discount the visits to
296 // pages visited less than ten times. 289 // pages visited less than ten times.
297 static bool HQPFixFewVisitsBug(); 290 static bool HQPFixFewVisitsBug();
298 291
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; 397 static const char kHUPNewScoringTypedCountRelevanceCapParam[];
405 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; 398 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[];
406 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; 399 static const char kHUPNewScoringTypedCountScoreBucketsParam[];
407 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; 400 static const char kHUPNewScoringTypedCountUseDecayFactorParam[];
408 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; 401 static const char kHUPNewScoringVisitedCountRelevanceCapParam[];
409 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; 402 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[];
410 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; 403 static const char kHUPNewScoringVisitedCountScoreBucketsParam[];
411 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[]; 404 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[];
412 405
413 // Parameter names used by the HQP experimental scoring experiments. 406 // Parameter names used by the HQP experimental scoring experiments.
414 static const char kHQPExperimentalScoringEnabledParam[];
415 static const char kHQPExperimentalScoringBucketsParam[]; 407 static const char kHQPExperimentalScoringBucketsParam[];
416 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; 408 static const char kHQPExperimentalScoringTopicalityThresholdParam[];
417 409
418 // The amount of time to wait before sending a new suggest request after the 410 // The amount of time to wait before sending a new suggest request after the
419 // previous one unless overridden by a field trial parameter. 411 // previous one unless overridden by a field trial parameter.
420 // Non-const because some unittests modify this value. 412 // Non-const because some unittests modify this value.
421 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; 413 static int kDefaultMinimumTimeBetweenSuggestQueriesMs;
422 414
423 private: 415 private:
424 friend class OmniboxFieldTrialTest; 416 friend class OmniboxFieldTrialTest;
(...skipping 14 matching lines...) Expand all
439 // prioritize different wildcard contexts, see the implementation. How to 431 // prioritize different wildcard contexts, see the implementation. How to
440 // interpret the value is left to the caller; this is rule-dependent. 432 // interpret the value is left to the caller; this is rule-dependent.
441 static std::string GetValueForRuleInContext( 433 static std::string GetValueForRuleInContext(
442 const std::string& rule, 434 const std::string& rule,
443 metrics::OmniboxEventProto::PageClassification page_classification); 435 metrics::OmniboxEventProto::PageClassification page_classification);
444 436
445 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); 437 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial);
446 }; 438 };
447 439
448 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ 440 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_
OLDNEW
« no previous file with comments | « no previous file | components/omnibox/browser/omnibox_field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698