OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SCORED_HISTORY_MATCH_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 19 matching lines...) Expand all Loading... |
30 using ScoreMaxRelevance = std::pair<double, int>; | 30 using ScoreMaxRelevance = std::pair<double, int>; |
31 | 31 |
32 // A sorted vector of ScoreMaxRelevance entries, used by taking a score and | 32 // A sorted vector of ScoreMaxRelevance entries, used by taking a score and |
33 // interpolating between consecutive buckets. See GetFinalRelevancyScore() | 33 // interpolating between consecutive buckets. See GetFinalRelevancyScore() |
34 // for details. | 34 // for details. |
35 using ScoreMaxRelevances = std::vector<ScoreMaxRelevance>; | 35 using ScoreMaxRelevances = std::vector<ScoreMaxRelevance>; |
36 | 36 |
37 // Required for STL, we don't use this directly. | 37 // Required for STL, we don't use this directly. |
38 ScoredHistoryMatch(); | 38 ScoredHistoryMatch(); |
39 ScoredHistoryMatch(const ScoredHistoryMatch& other); | 39 ScoredHistoryMatch(const ScoredHistoryMatch& other); |
| 40 ScoredHistoryMatch(ScoredHistoryMatch&& other); |
| 41 ScoredHistoryMatch& operator=(const ScoredHistoryMatch& other); |
| 42 ScoredHistoryMatch& operator=(ScoredHistoryMatch&& other); |
40 | 43 |
41 // Initializes the ScoredHistoryMatch with a raw score calculated for the | 44 // Initializes the ScoredHistoryMatch with a raw score calculated for the |
42 // history item given in |row| with recent visits as indicated in |visits|. It | 45 // history item given in |row| with recent visits as indicated in |visits|. It |
43 // first determines if the row qualifies by seeing if all of the terms in | 46 // first determines if the row qualifies by seeing if all of the terms in |
44 // |terms_vector| occur in |row|. If so, calculates a raw score. This raw | 47 // |terms_vector| occur in |row|. If so, calculates a raw score. This raw |
45 // score is in part determined by whether the matches occur at word | 48 // score is in part determined by whether the matches occur at word |
46 // boundaries, the locations of which are stored in |word_starts|. For some | 49 // boundaries, the locations of which are stored in |word_starts|. For some |
47 // terms, it's appropriate to look for the word boundary within the term. For | 50 // terms, it's appropriate to look for the word boundary within the term. For |
48 // instance, the term ".net" should look for a word boundary at the "n". | 51 // instance, the term ".net" should look for a word boundary at the "n". |
49 // These offsets (".net" should have an offset of 1) come from | 52 // These offsets (".net" should have an offset of 1) come from |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 static ScoreMaxRelevances* relevance_buckets_override_; | 206 static ScoreMaxRelevances* relevance_buckets_override_; |
204 | 207 |
205 // Used for testing. If this pointer is not null, it overrides the static | 208 // Used for testing. If this pointer is not null, it overrides the static |
206 // local variable |default_matches_to_specificity| declared in | 209 // local variable |default_matches_to_specificity| declared in |
207 // GetDocumentSpecificityScore(). | 210 // GetDocumentSpecificityScore(). |
208 static OmniboxFieldTrial::NumMatchesScores* matches_to_specificity_override_; | 211 static OmniboxFieldTrial::NumMatchesScores* matches_to_specificity_override_; |
209 }; | 212 }; |
210 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; | 213 typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |
211 | 214 |
212 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ | 215 #endif // COMPONENTS_OMNIBOX_BROWSER_SCORED_HISTORY_MATCH_H_ |
OLD | NEW |