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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "components/history/core/browser/download_database.h" | 12 #include "components/history/core/browser/download_database.h" |
13 #include "components/history/core/browser/url_database.h" | 13 #include "components/history/core/browser/url_database.h" |
14 #include "components/history/core/browser/visit_database.h" | 14 #include "components/history/core/browser/visit_database.h" |
15 #include "components/history/core/browser/visitsegment_database.h" | 15 #include "components/history/core/browser/visitsegment_database.h" |
16 #include "sql/connection.h" | 16 #include "sql/connection.h" |
17 #include "sql/init_status.h" | 17 #include "sql/init_status.h" |
18 #include "sql/meta_table.h" | 18 #include "sql/meta_table.h" |
19 | 19 |
20 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
21 #include "components/history/core/browser/android/android_cache_database.h" | 21 #include "components/history/core/browser/android/android_cache_database.h" |
22 #include "components/history/core/browser/android/android_urls_database.h" | 22 #include "components/history/core/browser/android/android_urls_database.h" |
23 #endif | 23 #endif |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class FilePath; | 26 class FilePath; |
27 } | 27 } |
28 | 28 |
29 class HistoryQuickProviderTest; | 29 class HistoryQuickProviderTest; |
| 30 class InMemoryURLIndexTest; |
30 | 31 |
31 namespace history { | 32 namespace history { |
32 | 33 |
33 // Encapsulates the SQL connection for the history database. This class holds | 34 // Encapsulates the SQL connection for the history database. This class holds |
34 // the database connection and has methods the history system (including full | 35 // the database connection and has methods the history system (including full |
35 // text search) uses for writing and retrieving information. | 36 // text search) uses for writing and retrieving information. |
36 // | 37 // |
37 // We try to keep most logic out of the history database; this should be seen | 38 // We try to keep most logic out of the history database; this should be seen |
38 // as the storage interface. Logic for manipulating this storage layer should | 39 // as the storage interface. Logic for manipulating this storage layer should |
39 // be in HistoryBackend.cc. | 40 // be in HistoryBackend.cc. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 virtual base::Time GetEarlyExpirationThreshold(); | 153 virtual base::Time GetEarlyExpirationThreshold(); |
153 virtual void UpdateEarlyExpirationThreshold(base::Time threshold); | 154 virtual void UpdateEarlyExpirationThreshold(base::Time threshold); |
154 | 155 |
155 private: | 156 private: |
156 #if defined(OS_ANDROID) | 157 #if defined(OS_ANDROID) |
157 // AndroidProviderBackend uses the |db_|. | 158 // AndroidProviderBackend uses the |db_|. |
158 friend class AndroidProviderBackend; | 159 friend class AndroidProviderBackend; |
159 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); | 160 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); |
160 #endif | 161 #endif |
161 friend class ::HistoryQuickProviderTest; | 162 friend class ::HistoryQuickProviderTest; |
162 friend class InMemoryURLIndexTest; | 163 friend class ::InMemoryURLIndexTest; |
163 | 164 |
164 // Overridden from URLDatabase: | 165 // Overridden from URLDatabase: |
165 sql::Connection& GetDB() override; | 166 sql::Connection& GetDB() override; |
166 | 167 |
167 // Migration ----------------------------------------------------------------- | 168 // Migration ----------------------------------------------------------------- |
168 | 169 |
169 // Makes sure the version is up-to-date, updating if necessary. If the | 170 // Makes sure the version is up-to-date, updating if necessary. If the |
170 // database is too old to migrate, the user will be notified. Returns | 171 // database is too old to migrate, the user will be notified. Returns |
171 // sql::INIT_OK iff the DB is up-to-date and ready for use. | 172 // sql::INIT_OK iff the DB is up-to-date and ready for use. |
172 // | 173 // |
(...skipping 14 matching lines...) Expand all Loading... |
187 sql::MetaTable meta_table_; | 188 sql::MetaTable meta_table_; |
188 | 189 |
189 base::Time cached_early_expiration_threshold_; | 190 base::Time cached_early_expiration_threshold_; |
190 | 191 |
191 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); | 192 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); |
192 }; | 193 }; |
193 | 194 |
194 } // namespace history | 195 } // namespace history |
195 | 196 |
196 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ | 197 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ |
OLD | NEW |