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 // Returns history URL matches | |
Mark P
2016/08/18 19:36:53
This comment doesn't say anything useful. You wan
Lavar Askew
2016/08/19 04:46:07
Done.
| |
54 ScoredHistoryMatches GetScoredItemsForSearchString( | |
55 const base::string16& search_string, | |
56 const HistoryIDSet& history_id_set, | |
57 const size_t& max_matches, | |
Mark P
2016/08/18 19:36:53
nit: please remove the & here; it's not useful
Lavar Askew
2016/08/19 04:46:07
Done.
| |
58 bookmarks::BookmarkModel* bookmark_model, | |
59 TemplateURLService* template_url_service); | |
60 | |
61 // Returns a vector of individual words based in the base::string16 | |
62 // search_string. Each index of the vector represents a single word | |
63 // in the search_string. | |
Mark P
2016/08/18 19:36:53
nit: shorter and clearer:
// Returns a vector of i
| |
64 String16Vector ExtractIndividualWordVector( | |
65 const base::string16& search_string); | |
66 | |
67 // Given a base::string16 in |term_string|, scans the history index and | |
Mark P
2016/08/18 19:36:53
nit: omit "base::string16" -- this is obvious from
Lavar Askew
2016/08/19 04:46:07
Done.
| |
68 // returns the set of history item IDs. Will return an emptyHistoryIDSet | |
Mark P
2016/08/18 19:36:53
after IDs, add "containing all the terms in |term_
Lavar Askew
2016/08/19 04:46:07
Done.
| |
69 // if the index has not been initialized or the search string has no words. | |
70 HistoryIDSet GetHistoryIDSet(const String16Vector& lower_words); | |
71 | |
53 // Given a base::string16 in |term_string|, scans the history index and | 72 // Given a base::string16 in |term_string|, scans the history index and |
54 // returns a vector with all scored, matching history items. The | 73 // returns a vector with all scored, matching history items. The |
55 // |term_string| is broken down into individual terms (words), each of which | 74 // |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 | 75 // 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 | 76 // to qualify; however, the terms do not necessarily have to be adjacent. We |
58 // also allow breaking |term_string| at |cursor_position| (if | 77 // also allow breaking |term_string| at |cursor_position| (if |
59 // set). Once we have a set of candidates, they are filtered to ensure | 78 // 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 | 79 // that all |term_string| terms, as separated by whitespace and the |
61 // cursor (if set), occur within the candidate's URL or page title. | 80 // cursor (if set), occur within the candidate's URL or page title. |
62 // Scores are then calculated on no more than |kItemsToScoreLimit| | 81 // 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_; | 406 int saved_cache_version_; |
388 | 407 |
389 // Used for unit testing only. Records the number of candidate history items | 408 // Used for unit testing only. Records the number of candidate history items |
390 // at three stages in the index searching process. | 409 // at three stages in the index searching process. |
391 size_t pre_filter_item_count_; // After word index is queried. | 410 size_t pre_filter_item_count_; // After word index is queried. |
392 size_t post_filter_item_count_; // After trimming large result set. | 411 size_t post_filter_item_count_; // After trimming large result set. |
393 size_t post_scoring_item_count_; // After performing final filter/scoring. | 412 size_t post_scoring_item_count_; // After performing final filter/scoring. |
394 }; | 413 }; |
395 | 414 |
396 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ | 415 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ |
OLD | NEW |