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

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: polish 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
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 // in case |kHQPExperimentalScoringBucketsParam| is not specified in the
275 static bool HQPExperimentalScoringEnabled();
276
277 // Returns the scoring buckets for HQP experiments. Returns empty string
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 275 // field trial. Scoring buckets are stored in string form giving mapping from
281 // (topicality_score, frequency_score) to final relevance score. 276 // (topicality_score, frequency_score) to final relevance score.
282 // Please see GetRelevancyScore() under 277 // Please see GetRelevancyScore() under
283 // chrome/browser/history::ScoredHistoryMatch for details. 278 // chrome/browser/history::ScoredHistoryMatch for details.
284 static std::string HQPExperimentalScoringBuckets(); 279 static std::string HQPExperimentalScoringBuckets();
285 280
286 // Returns the topicality threshold for HQP experiments. Returns -1 if 281 // Returns the topicality threshold for HQP experiments. Returns 0.8 if
Peter Kasting 2016/12/10 02:31:15 Nit: I dunno if it would be clearer to say "return
Mark P 2016/12/11 04:57:22 I agree. Made two changes: added the mention of "
287 // |kHQPExperimentalScoringTopicalityThresholdParam| or 282 // |kHQPExperimentalScoringTopicalityThresholdParam| is not specified in the
288 // |kHQPExperimentalScoringEnabledParam| is not specified in the field trial. 283 // field trial.
289 static float HQPExperimentalTopicalityThreshold(); 284 static float HQPExperimentalTopicalityThreshold();
290 285
291 // --------------------------------------------------------- 286 // ---------------------------------------------------------
292 // For the HQPFixFrequencyScoring experiment that's part of the 287 // For the HQPFixFrequencyScoring experiment that's part of the
293 // bundled omnibox field trial. 288 // bundled omnibox field trial.
294 289
295 // Returns true if HQP should apply the bug fix to discount the visits to 290 // Returns true if HQP should apply the bug fix to discount the visits to
296 // pages visited less than ten times. 291 // pages visited less than ten times.
297 static bool HQPFixFewVisitsBug(); 292 static bool HQPFixFewVisitsBug();
298 293
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 static const char kHUPNewScoringTypedCountRelevanceCapParam[]; 399 static const char kHUPNewScoringTypedCountRelevanceCapParam[];
405 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[]; 400 static const char kHUPNewScoringTypedCountHalfLifeTimeParam[];
406 static const char kHUPNewScoringTypedCountScoreBucketsParam[]; 401 static const char kHUPNewScoringTypedCountScoreBucketsParam[];
407 static const char kHUPNewScoringTypedCountUseDecayFactorParam[]; 402 static const char kHUPNewScoringTypedCountUseDecayFactorParam[];
408 static const char kHUPNewScoringVisitedCountRelevanceCapParam[]; 403 static const char kHUPNewScoringVisitedCountRelevanceCapParam[];
409 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[]; 404 static const char kHUPNewScoringVisitedCountHalfLifeTimeParam[];
410 static const char kHUPNewScoringVisitedCountScoreBucketsParam[]; 405 static const char kHUPNewScoringVisitedCountScoreBucketsParam[];
411 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[]; 406 static const char kHUPNewScoringVisitedCountUseDecayFactorParam[];
412 407
413 // Parameter names used by the HQP experimental scoring experiments. 408 // Parameter names used by the HQP experimental scoring experiments.
414 static const char kHQPExperimentalScoringEnabledParam[];
415 static const char kHQPExperimentalScoringBucketsParam[]; 409 static const char kHQPExperimentalScoringBucketsParam[];
416 static const char kHQPExperimentalScoringTopicalityThresholdParam[]; 410 static const char kHQPExperimentalScoringTopicalityThresholdParam[];
417 411
418 // The amount of time to wait before sending a new suggest request after the 412 // The amount of time to wait before sending a new suggest request after the
419 // previous one unless overridden by a field trial parameter. 413 // previous one unless overridden by a field trial parameter.
420 // Non-const because some unittests modify this value. 414 // Non-const because some unittests modify this value.
421 static int kDefaultMinimumTimeBetweenSuggestQueriesMs; 415 static int kDefaultMinimumTimeBetweenSuggestQueriesMs;
422 416
423 private: 417 private:
424 friend class OmniboxFieldTrialTest; 418 friend class OmniboxFieldTrialTest;
(...skipping 14 matching lines...) Expand all
439 // prioritize different wildcard contexts, see the implementation. How to 433 // prioritize different wildcard contexts, see the implementation. How to
440 // interpret the value is left to the caller; this is rule-dependent. 434 // interpret the value is left to the caller; this is rule-dependent.
441 static std::string GetValueForRuleInContext( 435 static std::string GetValueForRuleInContext(
442 const std::string& rule, 436 const std::string& rule,
443 metrics::OmniboxEventProto::PageClassification page_classification); 437 metrics::OmniboxEventProto::PageClassification page_classification);
444 438
445 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial); 439 DISALLOW_IMPLICIT_CONSTRUCTORS(OmniboxFieldTrial);
446 }; 440 };
447 441
448 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_FIELD_TRIAL_H_ 442 #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') | components/omnibox/browser/scored_history_match.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698