| 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 CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 #include <set> | 12 #include <set> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "content/common/appcache_interfaces.h" | 19 #include "content/common/appcache_interfaces.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 22 | 22 |
| 23 namespace sql { | 23 namespace sql { |
| 24 class Connection; | 24 class Connection; |
| 25 class MetaTable; | 25 class MetaTable; |
| 26 class Statement; | 26 class Statement; |
| 27 class StatementID; | 27 class StatementID; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void ResetConnectionAndTables(); | 227 void ResetConnectionAndTables(); |
| 228 | 228 |
| 229 // Deletes the existing database file and the entire directory containing | 229 // Deletes the existing database file and the entire directory containing |
| 230 // the database file including the disk cache in which response headers | 230 // the database file including the disk cache in which response headers |
| 231 // and bodies are stored, and then creates a new database file. | 231 // and bodies are stored, and then creates a new database file. |
| 232 bool DeleteExistingAndCreateNewDatabase(); | 232 bool DeleteExistingAndCreateNewDatabase(); |
| 233 | 233 |
| 234 void OnDatabaseError(int err, sql::Statement* stmt); | 234 void OnDatabaseError(int err, sql::Statement* stmt); |
| 235 | 235 |
| 236 base::FilePath db_file_path_; | 236 base::FilePath db_file_path_; |
| 237 scoped_ptr<sql::Connection> db_; | 237 std::unique_ptr<sql::Connection> db_; |
| 238 scoped_ptr<sql::MetaTable> meta_table_; | 238 std::unique_ptr<sql::MetaTable> meta_table_; |
| 239 std::map<int64_t, base::Time> lazy_last_access_times_; | 239 std::map<int64_t, base::Time> lazy_last_access_times_; |
| 240 bool is_disabled_; | 240 bool is_disabled_; |
| 241 bool is_recreating_; | 241 bool is_recreating_; |
| 242 bool was_corruption_detected_; | 242 bool was_corruption_detected_; |
| 243 | 243 |
| 244 friend class content::AppCacheDatabaseTest; | 244 friend class content::AppCacheDatabaseTest; |
| 245 friend class content::AppCacheStorageImplTest; | 245 friend class content::AppCacheStorageImplTest; |
| 246 | 246 |
| 247 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, CacheRecords); | 247 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, CacheRecords); |
| 248 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, EntryRecords); | 248 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, EntryRecords); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 262 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to7); | 262 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to7); |
| 263 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema5or6to7); | 263 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema5or6to7); |
| 264 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected); | 264 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected); |
| 265 | 265 |
| 266 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); | 266 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 } // namespace content | 269 } // namespace content |
| 270 | 270 |
| 271 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 271 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
| OLD | NEW |