Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: webkit/browser/appcache/appcache_database.h

Issue 137493003: Appcache::OnCorruptionDetected handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/content_tests.gypi ('k') | webkit/browser/appcache/appcache_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 GURL namespace_url; 79 GURL namespace_url;
80 bool is_pattern; 80 bool is_pattern;
81 }; 81 };
82 82
83 explicit AppCacheDatabase(const base::FilePath& path); 83 explicit AppCacheDatabase(const base::FilePath& path);
84 ~AppCacheDatabase(); 84 ~AppCacheDatabase();
85 85
86 void CloseConnection(); 86 void CloseConnection();
87 void Disable(); 87 void Disable();
88 bool is_disabled() const { return is_disabled_; } 88 bool is_disabled() const { return is_disabled_; }
89 bool was_corruption_detected() const { return was_corruption_detected_; }
89 90
90 int64 GetOriginUsage(const GURL& origin); 91 int64 GetOriginUsage(const GURL& origin);
91 bool GetAllOriginUsage(std::map<GURL, int64>* usage_map); 92 bool GetAllOriginUsage(std::map<GURL, int64>* usage_map);
92 93
93 bool FindOriginsWithGroups(std::set<GURL>* origins); 94 bool FindOriginsWithGroups(std::set<GURL>* origins);
94 bool FindLastStorageIds( 95 bool FindLastStorageIds(
95 int64* last_group_id, int64* last_cache_id, int64* last_response_id, 96 int64* last_group_id, int64* last_cache_id, int64* last_response_id,
96 int64* last_deletable_response_rowid); 97 int64* last_deletable_response_rowid);
97 98
98 bool FindGroup(int64 group_id, GroupRecord* record); 99 bool FindGroup(int64 group_id, GroupRecord* record);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 bool CreateSchema(); 193 bool CreateSchema();
193 bool UpgradeSchema(); 194 bool UpgradeSchema();
194 195
195 void ResetConnectionAndTables(); 196 void ResetConnectionAndTables();
196 197
197 // Deletes the existing database file and the entire directory containing 198 // Deletes the existing database file and the entire directory containing
198 // the database file including the disk cache in which response headers 199 // the database file including the disk cache in which response headers
199 // and bodies are stored, and then creates a new database file. 200 // and bodies are stored, and then creates a new database file.
200 bool DeleteExistingAndCreateNewDatabase(); 201 bool DeleteExistingAndCreateNewDatabase();
201 202
203 void OnDatabaseError(int err, sql::Statement* stmt);
204
202 base::FilePath db_file_path_; 205 base::FilePath db_file_path_;
203 scoped_ptr<sql::Connection> db_; 206 scoped_ptr<sql::Connection> db_;
204 scoped_ptr<sql::MetaTable> meta_table_; 207 scoped_ptr<sql::MetaTable> meta_table_;
205 bool is_disabled_; 208 bool is_disabled_;
206 bool is_recreating_; 209 bool is_recreating_;
210 bool was_corruption_detected_;
207 211
212 friend class AppCacheStorageImplTest;
208 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, CacheRecords); 213 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, CacheRecords);
209 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, EntryRecords); 214 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, EntryRecords);
210 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, QuickIntegrityCheck); 215 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, QuickIntegrityCheck);
211 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, NamespaceRecords); 216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, NamespaceRecords);
212 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, GroupRecords); 217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, GroupRecords);
213 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, LazyOpen); 218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, LazyOpen);
214 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ExperimentalFlags); 219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ExperimentalFlags);
215 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OnlineWhiteListRecords); 220 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OnlineWhiteListRecords);
216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ReCreate); 221 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ReCreate);
217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds); 222 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds);
218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); 223 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage);
219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5); 224 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5);
220 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5); 225 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5);
226 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, WasCorrutionDetected);
221 227
222 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); 228 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase);
223 }; 229 };
224 230
225 } // namespace appcache 231 } // namespace appcache
226 232
227 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 233 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | webkit/browser/appcache/appcache_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698