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 CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ |
6 #define CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ | 6 #define CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // candidates may cause perceptible typing response delays in the omnibox. | 134 // candidates may cause perceptible typing response delays in the omnibox. |
135 // This is likely to occur for short omnibox terms such as 'h' and 'w' which | 135 // This is likely to occur for short omnibox terms such as 'h' and 'w' which |
136 // will be found in nearly all history candidates. Results are sorted by | 136 // will be found in nearly all history candidates. Results are sorted by |
137 // descending score. The full results set (i.e. beyond the | 137 // descending score. The full results set (i.e. beyond the |
138 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls | 138 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls |
139 // to this function. | 139 // to this function. |
140 ScoredHistoryMatches HistoryItemsForTerms(const string16& term_string); | 140 ScoredHistoryMatches HistoryItemsForTerms(const string16& term_string); |
141 | 141 |
142 // Creates a new URLIndexPrivateData object, populates it from the contents | 142 // Creates a new URLIndexPrivateData object, populates it from the contents |
143 // of the cache file stored in |file_path|, and assigns it to |private_data|. | 143 // of the cache file stored in |file_path|, and assigns it to |private_data|. |
144 // |languages| will be used to break URLs and page titles into words and is | 144 // |languages| will be used to break URLs and page titles into words. |
145 // deliberately passed by value. | |
146 static void RestoreFromFileTask( | 145 static void RestoreFromFileTask( |
147 const FilePath& file_path, | 146 const FilePath& file_path, |
148 scoped_refptr<URLIndexPrivateData> private_data, | 147 scoped_refptr<URLIndexPrivateData> private_data, |
149 std::string languages); | 148 const std::string& languages); |
150 | 149 |
151 // Constructs a new object by restoring its contents from the file at |path|. | 150 // Constructs a new object by restoring its contents from the file at |path|. |
152 // Returns the new URLIndexPrivateData which on success will contain the | 151 // Returns the new URLIndexPrivateData which on success will contain the |
153 // restored data but upon failure will be empty. |languages| will be used to | 152 // restored data but upon failure will be empty. |languages| will be used to |
154 // break URLs and page titles into words | 153 // break URLs and page titles into words |
155 static scoped_refptr<URLIndexPrivateData> RestoreFromFile( | 154 static scoped_refptr<URLIndexPrivateData> RestoreFromFile( |
156 const FilePath& path, | 155 const FilePath& path, |
157 const std::string& languages); | 156 const std::string& languages); |
158 | 157 |
159 // Constructs a new object by rebuilding its contents from the history | 158 // Constructs a new object by rebuilding its contents from the history |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // Used for unit testing only. Records the number of candidate history items | 365 // Used for unit testing only. Records the number of candidate history items |
367 // at three stages in the index searching process. | 366 // at three stages in the index searching process. |
368 size_t pre_filter_item_count_; // After word index is queried. | 367 size_t pre_filter_item_count_; // After word index is queried. |
369 size_t post_filter_item_count_; // After trimming large result set. | 368 size_t post_filter_item_count_; // After trimming large result set. |
370 size_t post_scoring_item_count_; // After performing final filter/scoring. | 369 size_t post_scoring_item_count_; // After performing final filter/scoring. |
371 }; | 370 }; |
372 | 371 |
373 } // namespace history | 372 } // namespace history |
374 | 373 |
375 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ | 374 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ |
OLD | NEW |