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 // The InMemoryHistoryBackend is a wrapper around the in-memory URL database. | 5 // The InMemoryHistoryBackend is a wrapper around the in-memory URL database. |
6 // It maintains an in-memory cache of a subset of history that is required for | 6 // It maintains an in-memory cache of a subset of history that is required for |
7 // low-latency operations, such as in-line autocomplete. | 7 // low-latency operations, such as in-line autocomplete. |
8 // | 8 // |
9 // The in-memory cache provides the following guarantees: | 9 // The in-memory cache provides the following guarantees: |
10 // (1.) It will always contain URLRows that either have a |typed_count| > 0; or | 10 // (1.) It will always contain URLRows that either have a |typed_count| > 0; or |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool expired, | 84 bool expired, |
85 const URLRows& deleted_rows, | 85 const URLRows& deleted_rows, |
86 const std::set<GURL>& favicon_urls) override; | 86 const std::set<GURL>& favicon_urls) override; |
87 void OnKeywordSearchTermUpdated(HistoryService* history_service, | 87 void OnKeywordSearchTermUpdated(HistoryService* history_service, |
88 const URLRow& row, | 88 const URLRow& row, |
89 KeywordID keyword_id, | 89 KeywordID keyword_id, |
90 const base::string16& term) override; | 90 const base::string16& term) override; |
91 void OnKeywordSearchTermDeleted(HistoryService* history_service, | 91 void OnKeywordSearchTermDeleted(HistoryService* history_service, |
92 URLID url_id) override; | 92 URLID url_id) override; |
93 | 93 |
94 private: | |
95 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); | |
96 | |
97 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. | 94 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. |
98 void OnURLVisitedOrModified(const URLRow& url_row); | 95 void OnURLVisitedOrModified(const URLRow& url_row); |
99 | 96 |
100 scoped_ptr<InMemoryDatabase> db_; | 97 scoped_ptr<InMemoryDatabase> db_; |
101 | 98 |
102 ScopedObserver<HistoryService, HistoryServiceObserver> | 99 ScopedObserver<HistoryService, HistoryServiceObserver> |
103 history_service_observer_; | 100 history_service_observer_; |
104 | 101 |
105 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); | 102 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); |
106 }; | 103 }; |
107 | 104 |
108 } // namespace history | 105 } // namespace history |
109 | 106 |
110 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ | 107 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ |
OLD | NEW |