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_URL_INDEX_PRIVATE_DATA_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // this class is for exclusive use by the InMemoryURLIndex class there should | 43 // this class is for exclusive use by the InMemoryURLIndex class there should |
44 // be no calls from any other class. | 44 // be no calls from any other class. |
45 // | 45 // |
46 // All public member functions are called on the main thread unless otherwise | 46 // All public member functions are called on the main thread unless otherwise |
47 // annotated. | 47 // annotated. |
48 class URLIndexPrivateData | 48 class URLIndexPrivateData |
49 : public base::RefCountedThreadSafe<URLIndexPrivateData> { | 49 : public base::RefCountedThreadSafe<URLIndexPrivateData> { |
50 public: | 50 public: |
51 URLIndexPrivateData(); | 51 URLIndexPrivateData(); |
52 | 52 |
53 bool TrimCandidatePool ( | |
Mark P
2016/08/10 17:46:20
All of these function should be private. They're
Mark P
2016/08/10 17:46:20
This function and the one below should be commente
Mark P
2016/08/10 17:46:20
Here and throughout the change, you introduce a nu
Lavar Askew
2016/08/18 03:07:52
Done.
Lavar Askew
2016/08/18 03:07:52
"git cl format" did not make any suggestions for m
| |
54 HistoryIDSet history_id_set); | |
55 | |
56 ScoredHistoryMatches GetScoredItemsForSearchString( | |
Mark P
2016/08/10 17:46:19
Most of this class calls this parameter a "term_st
Lavar Askew
2016/08/18 03:07:52
search_string was the name of the variable before
| |
57 base::string16 search_string, | |
58 HistoryIDSet history_id_set, | |
59 size_t max_matches, | |
60 bookmarks::BookmarkModel* bookmark_model, | |
61 TemplateURLService* template_url_service); | |
62 | |
63 // Given a base::string16 in |term_string|, scans the history index and | |
64 // returns the set of history item IDs. | |
65 HistoryIDSet HistoryItemsForWords( | |
Mark P
2016/08/10 17:46:19
This function is confusingly named. It sounds a l
Lavar Askew
2016/08/18 03:07:52
Done.
| |
66 base::string16 search_string); | |
67 | |
53 // Given a base::string16 in |term_string|, scans the history index and | 68 // Given a base::string16 in |term_string|, scans the history index and |
54 // returns a vector with all scored, matching history items. The | 69 // returns a vector with all scored, matching history items. The |
55 // |term_string| is broken down into individual terms (words), each of which | 70 // |term_string| is broken down into individual terms (words), each of which |
56 // must occur in the candidate history item's URL or page title for the item | 71 // must occur in the candidate history item's URL or page title for the item |
57 // to qualify; however, the terms do not necessarily have to be adjacent. We | 72 // to qualify; however, the terms do not necessarily have to be adjacent. We |
58 // also allow breaking |term_string| at |cursor_position| (if | 73 // also allow breaking |term_string| at |cursor_position| (if |
59 // set). Once we have a set of candidates, they are filtered to ensure | 74 // set). Once we have a set of candidates, they are filtered to ensure |
60 // that all |term_string| terms, as separated by whitespace and the | 75 // that all |term_string| terms, as separated by whitespace and the |
61 // cursor (if set), occur within the candidate's URL or page title. | 76 // cursor (if set), occur within the candidate's URL or page title. |
62 // Scores are then calculated on no more than |kItemsToScoreLimit| | 77 // Scores are then calculated on no more than |kItemsToScoreLimit| |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 int saved_cache_version_; | 402 int saved_cache_version_; |
388 | 403 |
389 // Used for unit testing only. Records the number of candidate history items | 404 // Used for unit testing only. Records the number of candidate history items |
390 // at three stages in the index searching process. | 405 // at three stages in the index searching process. |
391 size_t pre_filter_item_count_; // After word index is queried. | 406 size_t pre_filter_item_count_; // After word index is queried. |
392 size_t post_filter_item_count_; // After trimming large result set. | 407 size_t post_filter_item_count_; // After trimming large result set. |
393 size_t post_scoring_item_count_; // After performing final filter/scoring. | 408 size_t post_scoring_item_count_; // After performing final filter/scoring. |
394 }; | 409 }; |
395 | 410 |
396 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ | 411 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ |
OLD | NEW |