| 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 |
| 11 // that have a corresponding search term, in which case information about | 11 // that have a corresponding search term, in which case information about |
| 12 // the search term is also stored. | 12 // the search term is also stored. |
| 13 // (2.) It will be an actual subset, i.e., it will contain verbatim data, and | 13 // (2.) It will be an actual subset, i.e., it will contain verbatim data, and |
| 14 // will never contain more data that can be found in the main database. | 14 // will never contain more data that can be found in the main database. |
| 15 // | 15 // |
| 16 // The InMemoryHistoryBackend is created on the history thread and passed to the | 16 // The InMemoryHistoryBackend is created on the history thread and passed to the |
| 17 // main thread where operations can be completed synchronously. It listens for | 17 // main thread where operations can be completed synchronously. It listens for |
| 18 // notifications from the "regular" history backend and keeps itself in sync. | 18 // notifications from the "regular" history backend and keeps itself in sync. |
| 19 | 19 |
| 20 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ | 20 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ |
| 21 #define COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ | 21 #define COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ |
| 22 | 22 |
| 23 #include <string> | 23 #include <string> |
| 24 | 24 |
| 25 #include "base/basictypes.h" | |
| 26 #include "base/gtest_prod_util.h" | 25 #include "base/gtest_prod_util.h" |
| 26 #include "base/macros.h" |
| 27 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
| 28 #include "base/scoped_observer.h" | 28 #include "base/scoped_observer.h" |
| 29 #include "components/history/core/browser/history_service_observer.h" | 29 #include "components/history/core/browser/history_service_observer.h" |
| 30 #include "components/history/core/browser/keyword_id.h" | 30 #include "components/history/core/browser/keyword_id.h" |
| 31 | 31 |
| 32 namespace base { | 32 namespace base { |
| 33 class FilePath; | 33 class FilePath; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace history { | 36 namespace history { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 ScopedObserver<HistoryService, HistoryServiceObserver> | 98 ScopedObserver<HistoryService, HistoryServiceObserver> |
| 99 history_service_observer_; | 99 history_service_observer_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); | 101 DISALLOW_COPY_AND_ASSIGN(InMemoryHistoryBackend); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace history | 104 } // namespace history |
| 105 | 105 |
| 106 #endif // COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ | 106 #endif // COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_ |
| OLD | NEW |