Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: chrome/browser/history/url_index_private_data.h

Issue 296743009: Pass AutocompleteProvider::kMaxMatches to InMemoryURLIndex (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // cursor (if set), occur within the candidate's URL or page title. 58 // cursor (if set), occur within the candidate's URL or page title.
59 // Scores are then calculated on no more than |kItemsToScoreLimit| 59 // Scores are then calculated on no more than |kItemsToScoreLimit|
60 // candidates, as the scoring of such a large number of candidates may 60 // candidates, as the scoring of such a large number of candidates may
61 // cause perceptible typing response delays in the omnibox. This is 61 // cause perceptible typing response delays in the omnibox. This is
62 // likely to occur for short omnibox terms such as 'h' and 'w' which 62 // likely to occur for short omnibox terms such as 'h' and 'w' which
63 // will be found in nearly all history candidates. Results are sorted by 63 // will be found in nearly all history candidates. Results are sorted by
64 // descending score. The full results set (i.e. beyond the 64 // descending score. The full results set (i.e. beyond the
65 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls 65 // |kItemsToScoreLimit| limit) will be retained and used for subsequent calls
66 // to this function. |bookmark_service| is used to boost a result's score if 66 // to this function. |bookmark_service| is used to boost a result's score if
67 // its URL is referenced by one or more of the user's bookmarks. |languages| 67 // its URL is referenced by one or more of the user's bookmarks. |languages|
68 // is used to help parse/format the URLs in the history index. 68 // is used to help parse/format the URLs in the history index. In total,
69 // |max_matches| of items will be returned in the |ScoredHistoryMatches|
70 // vector.
69 ScoredHistoryMatches HistoryItemsForTerms(base::string16 term_string, 71 ScoredHistoryMatches HistoryItemsForTerms(base::string16 term_string,
70 size_t cursor_position, 72 size_t cursor_position,
73 size_t max_matches,
71 const std::string& languages, 74 const std::string& languages,
72 BookmarkService* bookmark_service); 75 BookmarkService* bookmark_service);
73 76
74 // Adds the history item in |row| to the index if it does not already already 77 // Adds the history item in |row| to the index if it does not already already
75 // exist and it meets the minimum 'quick' criteria. If the row already exists 78 // exist and it meets the minimum 'quick' criteria. If the row already exists
76 // in the index then the index will be updated if the row still meets the 79 // in the index then the index will be updated if the row still meets the
77 // criteria, otherwise the row will be removed from the index. Returns true 80 // criteria, otherwise the row will be removed from the index. Returns true
78 // if the index was actually updated. |languages| gives a list of language 81 // if the index was actually updated. |languages| gives a list of language
79 // encodings by which the URLs and page titles are broken down into words and 82 // encodings by which the URLs and page titles are broken down into words and
80 // characters. |scheme_whitelist| is used to filter non-qualifying schemes. 83 // characters. |scheme_whitelist| is used to filter non-qualifying schemes.
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // Used for unit testing only. Records the number of candidate history items 392 // Used for unit testing only. Records the number of candidate history items
390 // at three stages in the index searching process. 393 // at three stages in the index searching process.
391 size_t pre_filter_item_count_; // After word index is queried. 394 size_t pre_filter_item_count_; // After word index is queried.
392 size_t post_filter_item_count_; // After trimming large result set. 395 size_t post_filter_item_count_; // After trimming large result set.
393 size_t post_scoring_item_count_; // After performing final filter/scoring. 396 size_t post_scoring_item_count_; // After performing final filter/scoring.
394 }; 397 };
395 398
396 } // namespace history 399 } // namespace history
397 400
398 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_ 401 #endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/history/in_memory_url_index_unittest.cc ('k') | chrome/browser/history/url_index_private_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698