summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 04:45:13 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 04:45:13 +0000
commitfed734a145c6defbf1063b3b9a497aee88db720d (patch)
tree3f8fe3a0e49f57a42c1bb514e4f7c145c6c5195c /sql/connection.h
parent5b7355bcdf73ef995001d0cf8fbf2385012a7a52 (diff)
downloadchromium_src-fed734a145c6defbf1063b3b9a497aee88db720d.zip
chromium_src-fed734a145c6defbf1063b3b9a497aee88db720d.tar.gz
chromium_src-fed734a145c6defbf1063b3b9a497aee88db720d.tar.bz2
[sql] Retry Open() if error handler fixed things.
Since the caller cannot have existing database-derived state before the database is opened, Open() can be safely retried after the error handler has razed the database. BUG=109482 Review URL: https://chromiumcodereview.appspot.com/18641004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r--sql/connection.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/connection.h b/sql/connection.h
index 8155a8f..1c4d72c 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -360,7 +360,14 @@ class SQL_EXPORT Connection {
// Internal initialize function used by both Init and InitInMemory. The file
// name is always 8 bits since we want to use the 8-bit version of
// sqlite3_open. The string can also be sqlite's special ":memory:" string.
- bool OpenInternal(const std::string& file_name);
+ //
+ // |retry_flag| controls retrying the open if the error callback
+ // addressed errors using RazeAndClose().
+ enum Retry {
+ NO_RETRY = 0,
+ RETRY_ON_POISON
+ };
+ bool OpenInternal(const std::string& file_name, Retry retry_flag);
// Internal close function used by Close() and RazeAndClose().
// |forced| indicates that orderly-shutdown checks should not apply.