summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 12:42:42 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 12:42:42 +0000
commit80abf155a940e0276c58e7b29f9c7d293dca4847 (patch)
tree5c698b843dd6aa6c9f7b3b19ff46a5be4ac5ff2d /sql/connection.h
parent8812e3d07c527b8fd43e4bb27b6a4c886bb888b5 (diff)
downloadchromium_src-80abf155a940e0276c58e7b29f9c7d293dca4847.zip
chromium_src-80abf155a940e0276c58e7b29f9c7d293dca4847.tar.gz
chromium_src-80abf155a940e0276c58e7b29f9c7d293dca4847.tar.bz2
Post integrity_check data for corrupt thumbnail databases.
Analyzing the results from DatabaseErrorCallback() show a lot of SQLITE_CORRUPT opening the database and setting up the meta table. Add additional diagnostic information for these cases to direct future development, and also dial down the amount of data uploaded to allow finding other cases more easily. For SQLITE_CORRUPT and SQLITE_READONLY, only give the chance to report on first encounter. Cross-platform results are inconsistent. On OSX, almost all of the SQLITE_CORRUPT cases are in initialization, whereas on Windows there are more in code which updates the database. For these errors, it is reasonable to expect any future call to return the error again, so it is pointless to let it get multiple attempts. BUG=240396 Review URL: https://chromiumcodereview.appspot.com/15327004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201494 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r--sql/connection.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/connection.h b/sql/connection.h
index 96312c4..049d7cf 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -8,6 +8,7 @@
#include <map>
#include <set>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
@@ -180,6 +181,12 @@ 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);
+
// Initialization ------------------------------------------------------------
// Initializes the SQL connection for the given file, returning true if the