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

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

Issue 104593010: AppCache: Run a quick integrity check on the sqlite database when opening. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 sql::Statement* statement, 181 sql::Statement* statement,
182 NamespaceRecordVector* intercepts, 182 NamespaceRecordVector* intercepts,
183 NamespaceRecordVector* fallbacks); 183 NamespaceRecordVector* fallbacks);
184 void ReadNamespaceRecord( 184 void ReadNamespaceRecord(
185 const sql::Statement* statement, NamespaceRecord* record); 185 const sql::Statement* statement, NamespaceRecord* record);
186 void ReadOnlineWhiteListRecord( 186 void ReadOnlineWhiteListRecord(
187 const sql::Statement& statement, OnlineWhiteListRecord* record); 187 const sql::Statement& statement, OnlineWhiteListRecord* record);
188 188
189 // Database creation 189 // Database creation
190 bool LazyOpen(bool create_if_needed); 190 bool LazyOpen(bool create_if_needed);
191 bool QuickIntegrityCheck();
191 bool EnsureDatabaseVersion(); 192 bool EnsureDatabaseVersion();
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
202 base::FilePath db_file_path_; 203 base::FilePath db_file_path_;
203 scoped_ptr<sql::Connection> db_; 204 scoped_ptr<sql::Connection> db_;
204 scoped_ptr<sql::MetaTable> meta_table_; 205 scoped_ptr<sql::MetaTable> meta_table_;
205 bool is_disabled_; 206 bool is_disabled_;
206 bool is_recreating_; 207 bool is_recreating_;
207 208
208 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, CacheRecords); 209 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, CacheRecords);
209 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, EntryRecords); 210 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, EntryRecords);
211 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, QuickIntegrityCheck);
210 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, NamespaceRecords); 212 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, NamespaceRecords);
211 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, GroupRecords); 213 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, GroupRecords);
212 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, LazyOpen); 214 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, LazyOpen);
213 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ExperimentalFlags); 215 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ExperimentalFlags);
214 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OnlineWhiteListRecords); 216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OnlineWhiteListRecords);
215 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ReCreate); 217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, ReCreate);
216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds); 218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds);
217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); 219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage);
218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5); 220 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5);
219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5); 221 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5);
220 222
221 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); 223 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase);
222 }; 224 };
223 225
224 } // namespace appcache 226 } // namespace appcache
225 227
226 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ 228 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698