Implement sql::Connection::RazeAndClose().
commit41a97c81e1bd78eddc704b00bdad106bf602778c
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 7 Feb 2013 02:35:38 +0000 (7 02:35 +0000)
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 7 Feb 2013 02:35:38 +0000 (7 02:35 +0000)
tree9fa9ee2eb911762eab05aea401f17e0c87ea6f3a
parentf9036e33644b0fccd9987cb759a17ba7e51b0b2e
Implement sql::Connection::RazeAndClose().

Raze() clears out the database, but cannot be called within a
transaction.  Close() can only be called once all statements have
cleared.  Error callbacks happen while executing statements (thus
often in a transaction, and at least one statement is outstanding).

RazeAndClose() forcibly breaks outstanding transactions, calls Raze()
to clear the database, then calls Close() to close the handle.  All
future operations against the database should fail safely (without
affecting storage and without crashing).

BUG=166419, 136846

Review URL: https://chromiumcodereview.appspot.com/12096073

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181152 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/extensions/activity_database.cc
chrome/browser/extensions/activity_database.h
chrome/browser/history/thumbnail_database.cc
chrome/browser/net/sqlite_persistent_cookie_store.cc
sql/connection.cc
sql/connection.h
sql/connection_unittest.cc
sql/statement.cc