summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-16 18:36:52 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-16 18:36:52 +0000
commit579446c1f83325c74e26e61b47a11c149e491a66 (patch)
treea297376e9fd53b8c24acb9b240ee880494c5567c /sql/connection.h
parent3e0d61e2bb88eb80058b63ac6a8b9ebff64cc4eb (diff)
downloadchromium_src-579446c1f83325c74e26e61b47a11c149e491a66.zip
chromium_src-579446c1f83325c74e26e61b47a11c149e491a66.tar.gz
chromium_src-579446c1f83325c74e26e61b47a11c149e491a66.tar.bz2
AppCache: Run a quick integrity check on the sqlite database when opening. If the test fails, delete the appcache directory and start afresh.
NOTRY=true TBR=sky BUG=318544 Review URL: https://codereview.chromium.org/104593010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r--sql/connection.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/sql/connection.h b/sql/connection.h
index ec76e3b..54c3f8b 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -150,11 +150,16 @@ class SQL_EXPORT Connection {
// histogram is recorded.
void AddTaggedHistogram(const std::string& name, size_t sample) const;
- // Run "PRAGMA integrity_check" and post each line of results into
- // |messages|. Returns the success of running the statement - per
- // the SQLite documentation, if no errors are found the call should
- // succeed, and a single value "ok" should be in messages.
- bool IntegrityCheck(std::vector<std::string>* messages);
+ // Run "PRAGMA integrity_check" and post each line of
+ // results into |messages|. Returns the success of running the
+ // statement - per the SQLite documentation, if no errors are found the
+ // call should succeed, and a single value "ok" should be in messages.
+ bool FullIntegrityCheck(std::vector<std::string>* messages);
+
+ // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method,
+ // interprets the results returning true if the the statement executes
+ // without error and results in a single "ok" value.
+ bool QuickIntegrityCheck() WARN_UNUSED_RESULT;
// Initialization ------------------------------------------------------------
@@ -540,6 +545,10 @@ class SQL_EXPORT Connection {
// case for const functions).
scoped_refptr<StatementRef> GetUntrackedStatement(const char* sql) const;
+ bool IntegrityCheckHelper(
+ const char* pragma_sql,
+ std::vector<std::string>* messages) WARN_UNUSED_RESULT;
+
// The actual sqlite database. Will be NULL before Init has been called or if
// Init resulted in an error.
sqlite3* db_;