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