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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // so that it can deal directly with this object, rather than the DB. | 71 // so that it can deal directly with this object, rather than the DB. |
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 virtual void OnURLVisited(HistoryService* history_service, | 77 virtual 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 | 82 |
83 // Notification callback. | 83 // Notification callback. |
84 virtual void Observe(int type, | 84 virtual void Observe(int type, |
85 const content::NotificationSource& source, | 85 const content::NotificationSource& source, |
86 const content::NotificationDetails& details) override; | 86 const content::NotificationDetails& details) override; |
87 | 87 |
88 private: | 88 private: |
89 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); | 89 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll); |
90 | 90 |
91 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. | 91 // Handler for HISTORY_URL_VISITED and HISTORY_URLS_MODIFIED. |
(...skipping 16 matching lines...) Expand all Loading... |
108 // initialization. | 108 // initialization. |
109 Profile* profile_; | 109 Profile* profile_; |
110 HistoryService* history_service_; | 110 HistoryService* history_service_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); | 112 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace history | 115 } // namespace history |
116 | 116 |
117 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ | 117 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_ |
OLD | NEW |