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_HISTORY_IN_MEMORY_URL_INDEX_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ | 6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // Signals that any outstanding initialization should be canceled and | 111 // Signals that any outstanding initialization should be canceled and |
112 // flushes the cache to disk. | 112 // flushes the cache to disk. |
113 void ShutDown(); | 113 void ShutDown(); |
114 | 114 |
115 // Scans the history index and returns a vector with all scored, matching | 115 // Scans the history index and returns a vector with all scored, matching |
116 // history items. This entry point simply forwards the call on to the | 116 // history items. This entry point simply forwards the call on to the |
117 // URLIndexPrivateData class. For a complete description of this function | 117 // URLIndexPrivateData class. For a complete description of this function |
118 // refer to that class. If |cursor_position| is base::string16::npos, the | 118 // refer to that class. If |cursor_position| is base::string16::npos, the |
119 // function doesn't do anything special with the cursor; this is equivalent | 119 // function doesn't do anything special with the cursor; this is equivalent |
120 // to the cursor being at the end. | 120 // to the cursor being at the end. In total, |max_matches| of items will be |
| 121 // returned in the |ScoredHistoryMatches| vector. |
121 ScoredHistoryMatches HistoryItemsForTerms(const base::string16& term_string, | 122 ScoredHistoryMatches HistoryItemsForTerms(const base::string16& term_string, |
122 size_t cursor_position); | 123 size_t cursor_position, |
| 124 size_t max_matches); |
123 | 125 |
124 // Deletes the index entry, if any, for the given |url|. | 126 // Deletes the index entry, if any, for the given |url|. |
125 void DeleteURL(const GURL& url); | 127 void DeleteURL(const GURL& url); |
126 | 128 |
127 // Sets the optional observers for completion of restoral and saving of the | 129 // Sets the optional observers for completion of restoral and saving of the |
128 // index's private data. | 130 // index's private data. |
129 void set_restore_cache_observer( | 131 void set_restore_cache_observer( |
130 RestoreCacheObserver* restore_cache_observer) { | 132 RestoreCacheObserver* restore_cache_observer) { |
131 restore_cache_observer_ = restore_cache_observer; | 133 restore_cache_observer_ = restore_cache_observer; |
132 } | 134 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // TODO(mrossetti): Eliminate once the transition to SQLite has been done. | 288 // TODO(mrossetti): Eliminate once the transition to SQLite has been done. |
287 // http://crbug.com/83659 | 289 // http://crbug.com/83659 |
288 bool needs_to_be_cached_; | 290 bool needs_to_be_cached_; |
289 | 291 |
290 DISALLOW_COPY_AND_ASSIGN(InMemoryURLIndex); | 292 DISALLOW_COPY_AND_ASSIGN(InMemoryURLIndex); |
291 }; | 293 }; |
292 | 294 |
293 } // namespace history | 295 } // namespace history |
294 | 296 |
295 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ | 297 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_ |
OLD | NEW |