Index: sql/connection.cc |
=================================================================== |
--- sql/connection.cc (revision 147339) |
+++ sql/connection.cc (working copy) |
@@ -76,14 +76,6 @@ |
void Connection::StatementRef::Close() { |
if (stmt_) { |
- // Call to AssertIOAllowed() cannot go at the beginning of the function |
- // because Close() is called unconditionally from destructor to clean |
- // connection_. And if this is inactive statement this won't cause any |
- // disk access and destructor most probably will be called on thread |
- // not allowing disk access. |
- // TODO(paivanof@gmail.com): This should move to the beginning |
- // of the function. http://crbug.com/136655. |
- AssertIOAllowed(); |
sqlite3_finalize(stmt_); |
stmt_ = NULL; |
} |
@@ -96,8 +88,7 @@ |
cache_size_(0), |
exclusive_locking_(false), |
transaction_nesting_(0), |
- needs_rollback_(false), |
- in_memory_(false) { |
+ needs_rollback_(false) { |
} |
Connection::~Connection() { |
@@ -113,7 +104,6 @@ |
} |
bool Connection::OpenInMemory() { |
- in_memory_ = true; |
return OpenInternal(":memory:"); |
} |
@@ -135,13 +125,6 @@ |
ClearCache(); |
if (db_) { |
- // Call to AssertIOAllowed() cannot go at the beginning of the function |
- // because Close() must be called from destructor to clean |
- // statement_cache_, it won't cause any disk access and it most probably |
- // will happen on thread not allowing disk access. |
- // TODO(paivanof@gmail.com): This should move to the beginning |
- // of the function. http://crbug.com/136655. |
- AssertIOAllowed(); |
// TODO(shess): Histogram for failure. |
sqlite3_close(db_); |
db_ = NULL; |
@@ -149,8 +132,6 @@ |
} |
void Connection::Preload() { |
- AssertIOAllowed(); |
- |
if (!db_) { |
DLOG(FATAL) << "Cannot preload null db"; |
return; |
@@ -175,8 +156,6 @@ |
// Create an in-memory database with the existing database's page |
// size, then backup that database over the existing database. |
bool Connection::Raze() { |
- AssertIOAllowed(); |
- |
if (!db_) { |
DLOG(FATAL) << "Cannot raze null db"; |
return false; |
@@ -313,7 +292,6 @@ |
} |
int Connection::ExecuteAndReturnErrorCode(const char* sql) { |
- AssertIOAllowed(); |
if (!db_) |
return false; |
return sqlite3_exec(db_, sql, NULL, NULL, NULL); |
@@ -364,8 +342,6 @@ |
scoped_refptr<Connection::StatementRef> Connection::GetUniqueStatement( |
const char* sql) { |
- AssertIOAllowed(); |
- |
if (!db_) |
return new StatementRef(this, NULL); // Return inactive statement. |
@@ -379,7 +355,6 @@ |
} |
bool Connection::IsSQLValid(const char* sql) { |
- AssertIOAllowed(); |
sqlite3_stmt* stmt = NULL; |
if (sqlite3_prepare_v2(db_, sql, -1, &stmt, NULL) != SQLITE_OK) |
return false; |
@@ -466,8 +441,6 @@ |
} |
bool Connection::OpenInternal(const std::string& file_name) { |
- AssertIOAllowed(); |
- |
if (db_) { |
DLOG(FATAL) << "sql::Connection is already open."; |
return false; |