| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 InMemoryDatabase* db() const { | 72 InMemoryDatabase* db() const { |
| 73 return db_.get(); | 73 return db_.get(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // HistoryServiceObserver: | 76 // HistoryServiceObserver: |
| 77 void OnURLVisited(HistoryService* history_service, | 77 void OnURLVisited(HistoryService* history_service, |
| 78 ui::PageTransition transition, | 78 ui::PageTransition transition, |
| 79 const URLRow& row, | 79 const URLRow& row, |
| 80 const RedirectList& redirects, | 80 const RedirectList& redirects, |
| 81 base::Time visit_time) override; | 81 base::Time visit_time) override; |
| 82 void OnURLsModified(HistoryService* history_service, |
| 83 const URLRows& changed_urls) override; |
| 82 | 84 |
| 83 // Notification callback. | 85 // Notification callback. |
| 84 void Observe(int type, | 86 void Observe(int type, |
| 85 const content::NotificationSource& source, | 87 const content::NotificationSource& source, |
| 86 const content::NotificationDetails& details) override; | 88 const content::NotificationDetails& details) override; |
| 87 | 89 |
| 88 private: | 90 private: |
| 89 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); | 91 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); |
| 90 | 92 |
| 91 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. | 93 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 108 // initialization. | 110 // initialization. |
| 109 Profile* profile_; | 111 Profile* profile_; |
| 110 HistoryService* history_service_; | 112 HistoryService* history_service_; |
| 111 | 113 |
| 112 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); | 114 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); |
| 113 }; | 115 }; |
| 114 | 116 |
| 115 } // namespace history | 117 } // namespace history |
| 116 | 118 |
| 117 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ | 119 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ |
| OLD | NEW |