Chromium Code Reviews| Index: components/omnibox/browser/url_index_private_data.h |
| diff --git a/components/omnibox/browser/url_index_private_data.h b/components/omnibox/browser/url_index_private_data.h |
| index 50bcf4b7ebc141548414f53a4b833f35de5717db..dcfbe9c02b2e6f230e7bbd321752c96aa1c60035 100644 |
| --- a/components/omnibox/browser/url_index_private_data.h |
| +++ b/components/omnibox/browser/url_index_private_data.h |
| @@ -146,13 +146,14 @@ class URLIndexPrivateData |
| friend class ::HistoryQuickProviderTest; |
| friend class InMemoryURLIndexTest; |
| - FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CalculateWordStartsOffsets); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CacheSaveRestore); |
| + FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, CalculateWordStartsOffsets); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, HugeResultSet); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, ReadVisitsFromHistory); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, RebuildFromHistoryIfCacheOld); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, Scoring); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TitleSearch); |
| + FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TrimHistortIds); |
|
dyaroshev
2017/02/24 01:29:27
typo
dyaroshev
2017/02/24 02:14:25
Done.
|
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TypedCharacterCaching); |
| FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, WhitelistedURLs); |
| FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization); |
| @@ -208,6 +209,14 @@ class URLIndexPrivateData |
| // in |unsorted_words|. |
| HistoryIDSet HistoryIDSetFromWords(const String16Vector& unsorted_words); |
| + // Trims the candidate pool in advance of doing proper substring searching, to |
| + // cap the cost of such searching. Discards the least-relevant items (based on |
| + // visit stats), which are least likely to score highly in the end. To |
| + // minimize the risk of discarding a valuable URL, the candidate pool is still |
| + // left two orders of magnitude larger than the final number of results |
| + // returned from the HQP. Returns whether anything was trimmed. |
| + bool TrimHistoryIdsPool(HistoryIDSet* history_id_set) const; |
| + |
| // Helper function to HistoryIDSetFromWords which composes a set of history |
| // ids for the given term given in |term|. |
| HistoryIDSet HistoryIDsForTerm(const base::string16& term); |
| @@ -379,12 +388,6 @@ class URLIndexPrivateData |
| // Used only for testing upgrading of an older version of the cache upon |
| // restore. |
| int saved_cache_version_; |
| - |
| - // Used for unit testing only. Records the number of candidate history items |
| - // at three stages in the index searching process. |
| - size_t pre_filter_item_count_; // After word index is queried. |
| - size_t post_filter_item_count_; // After trimming large result set. |
| - size_t post_scoring_item_count_; // After performing final filter/scoring. |
| }; |
| #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ |