summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 20:13:17 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 20:13:17 +0000
commit9cfbc92a930fd89a9ba1ef807f970ef09177d3ec (patch)
tree0e3943b97c93d2bd41be7fc982d5cb1531ab1399 /app
parent9e007ab4a4373f5e94657ecfa1f7e48c7ce15b05 (diff)
downloadchromium_src-9cfbc92a930fd89a9ba1ef807f970ef09177d3ec.zip
chromium_src-9cfbc92a930fd89a9ba1ef807f970ef09177d3ec.tar.gz
chromium_src-9cfbc92a930fd89a9ba1ef807f970ef09177d3ec.tar.bz2
Do not open a new connection if one has already been opened.
TEST=none BUG=none Review URL: http://codereview.chromium.org/405005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/sql/connection.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/sql/connection.cc b/app/sql/connection.cc
index dd3756e..8f74e6e 100644
--- a/app/sql/connection.cc
+++ b/app/sql/connection.cc
@@ -264,6 +264,11 @@ const char* Connection::GetErrorMessage() const {
}
bool Connection::OpenInternal(const std::string& file_name) {
+ if (db_) {
+ NOTREACHED() << "sql::Connection is already open.";
+ return false;
+ }
+
int err = sqlite3_open(file_name.c_str(), &db_);
if (err != SQLITE_OK) {
OnSqliteError(err, NULL);