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_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // from the cache or a complete rebuild from the history database. | 142 // from the cache or a complete rebuild from the history database. |
143 void Clear(); | 143 void Clear(); |
144 | 144 |
145 private: | 145 private: |
146 friend class base::RefCountedThreadSafe<URLIndexPrivateData>; | 146 friend class base::RefCountedThreadSafe<URLIndexPrivateData>; |
147 ~URLIndexPrivateData(); | 147 ~URLIndexPrivateData(); |
148 | 148 |
149 friend class AddHistoryMatch; | 149 friend class AddHistoryMatch; |
150 friend class ::HistoryQuickProviderTest; | 150 friend class ::HistoryQuickProviderTest; |
151 friend class InMemoryURLIndexTest; | 151 friend class InMemoryURLIndexTest; |
| 152 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, AddHistoryMatch); |
152 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CacheSaveRestore); | 153 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CacheSaveRestore); |
153 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, HugeResultSet); | 154 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, HugeResultSet); |
154 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, ReadVisitsFromHistory); | 155 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, ReadVisitsFromHistory); |
155 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, RebuildFromHistoryIfCacheOld); | 156 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, RebuildFromHistoryIfCacheOld); |
156 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, Scoring); | 157 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, Scoring); |
157 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TitleSearch); | 158 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TitleSearch); |
158 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TypedCharacterCaching); | 159 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TypedCharacterCaching); |
159 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, WhitelistedURLs); | 160 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, WhitelistedURLs); |
160 FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization); | 161 FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization); |
161 | 162 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 const base::string16& lower_string, | 201 const base::string16& lower_string, |
201 const String16Vector& lower_terms, | 202 const String16Vector& lower_terms, |
202 const base::Time now); | 203 const base::Time now); |
203 ~AddHistoryMatch(); | 204 ~AddHistoryMatch(); |
204 | 205 |
205 void operator()(const HistoryID history_id); | 206 void operator()(const HistoryID history_id); |
206 | 207 |
207 ScoredHistoryMatches ScoredMatches() const { return scored_matches_; } | 208 ScoredHistoryMatches ScoredMatches() const { return scored_matches_; } |
208 | 209 |
209 private: | 210 private: |
| 211 friend class InMemoryURLIndexTest; |
| 212 FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, AddHistoryMatch); |
210 bookmarks::BookmarkModel* bookmark_model_; | 213 bookmarks::BookmarkModel* bookmark_model_; |
211 const URLIndexPrivateData& private_data_; | 214 const URLIndexPrivateData& private_data_; |
212 const std::string& languages_; | 215 const std::string& languages_; |
213 ScoredHistoryMatches scored_matches_; | 216 ScoredHistoryMatches scored_matches_; |
214 const base::string16& lower_string_; | 217 const base::string16& lower_string_; |
215 const String16Vector& lower_terms_; | 218 const String16Vector& lower_terms_; |
216 WordStarts lower_terms_to_word_starts_offsets_; | 219 WordStarts lower_terms_to_word_starts_offsets_; |
217 const base::Time now_; | 220 const base::Time now_; |
218 }; | 221 }; |
219 | 222 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 int saved_cache_version_; | 401 int saved_cache_version_; |
399 | 402 |
400 // Used for unit testing only. Records the number of candidate history items | 403 // Used for unit testing only. Records the number of candidate history items |
401 // at three stages in the index searching process. | 404 // at three stages in the index searching process. |
402 size_t pre_filter_item_count_; // After word index is queried. | 405 size_t pre_filter_item_count_; // After word index is queried. |
403 size_t post_filter_item_count_; // After trimming large result set. | 406 size_t post_filter_item_count_; // After trimming large result set. |
404 size_t post_scoring_item_count_; // After performing final filter/scoring. | 407 size_t post_scoring_item_count_; // After performing final filter/scoring. |
405 }; | 408 }; |
406 | 409 |
407 #endif // CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ | 410 #endif // CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_ |
OLD | NEW |