| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); | 167 FRIEND_TEST_ALL_PREFIXES(AndroidURLsMigrationTest, MigrateToVersion22); |
| 168 #endif | 168 #endif |
| 169 friend class ::HistoryQuickProviderTest; | 169 friend class ::HistoryQuickProviderTest; |
| 170 friend class ::InMemoryURLIndexTest; | 170 friend class ::InMemoryURLIndexTest; |
| 171 | 171 |
| 172 // Overridden from URLDatabase: | 172 // Overridden from URLDatabase: |
| 173 sql::Connection& GetDB() override; | 173 sql::Connection& GetDB() override; |
| 174 | 174 |
| 175 // Migration ----------------------------------------------------------------- | 175 // Migration ----------------------------------------------------------------- |
| 176 | 176 |
| 177 // Makes sure the version is up-to-date, updating if necessary. If the | 177 // Makes sure the version is up to date, updating if necessary. If the |
| 178 // database is too old to migrate, the user will be notified. Returns | 178 // database is too old to migrate, the user will be notified. Returns |
| 179 // sql::INIT_OK iff the DB is up-to-date and ready for use. | 179 // sql::INIT_OK iff the DB is up to date and ready for use. |
| 180 // | 180 // |
| 181 // This assumes it is called from the init function inside a transaction. It | 181 // This assumes it is called from the init function inside a transaction. It |
| 182 // may commit the transaction and start a new one if migration requires it. | 182 // may commit the transaction and start a new one if migration requires it. |
| 183 sql::InitStatus EnsureCurrentVersion(); | 183 sql::InitStatus EnsureCurrentVersion(); |
| 184 | 184 |
| 185 #if !defined(OS_WIN) | 185 #if !defined(OS_WIN) |
| 186 // Converts the time epoch in the database from being 1970-based to being | 186 // Converts the time epoch in the database from being 1970-based to being |
| 187 // 1601-based which corresponds to the change in Time.internal_value_. | 187 // 1601-based which corresponds to the change in Time.internal_value_. |
| 188 void MigrateTimeEpoch(); | 188 void MigrateTimeEpoch(); |
| 189 #endif | 189 #endif |
| 190 | 190 |
| 191 // --------------------------------------------------------------------------- | 191 // --------------------------------------------------------------------------- |
| 192 | 192 |
| 193 sql::Connection::ErrorCallback error_callback_; | 193 sql::Connection::ErrorCallback error_callback_; |
| 194 sql::Connection db_; | 194 sql::Connection db_; |
| 195 sql::MetaTable meta_table_; | 195 sql::MetaTable meta_table_; |
| 196 | 196 |
| 197 base::Time cached_early_expiration_threshold_; | 197 base::Time cached_early_expiration_threshold_; |
| 198 | 198 |
| 199 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); | 199 DISALLOW_COPY_AND_ASSIGN(HistoryDatabase); |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 } // namespace history | 202 } // namespace history |
| 203 | 203 |
| 204 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ | 204 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DATABASE_H_ |
| OLD | NEW |