Index: content/browser/indexed_db/indexed_db_database.cc |
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc |
index 5ba4e4839e70b7c91c417f7d538a2c43a9e62dcf..5ec8f1dfb6ac099ac75ddc2c6ec911fbde47cd9d 100644 |
--- a/content/browser/indexed_db/indexed_db_database.cc |
+++ b/content/browser/indexed_db/indexed_db_database.cc |
@@ -123,6 +123,7 @@ IndexedDBDatabase::IndexedDBDatabase(const base::string16& name, |
kInvalidId), |
identifier_(unique_identifier), |
factory_(factory) { |
+ DCHECK(factory != NULL); |
} |
void IndexedDBDatabase::AddObjectStore( |
@@ -1360,9 +1361,6 @@ void IndexedDBDatabase::TransactionFinished(IndexedDBTransaction* transaction, |
} |
void IndexedDBDatabase::TransactionCommitFailed() { |
- // Factory may be null in unit tests. |
- if (!factory_) |
- return; |
factory_->HandleBackingStoreFailure(backing_store_->origin_url()); |
} |
@@ -1656,8 +1654,7 @@ void IndexedDBDatabase::DeleteDatabaseFinal( |
metadata_.int_version = IndexedDBDatabaseMetadata::NO_INT_VERSION; |
metadata_.object_stores.clear(); |
callbacks->OnSuccess(old_version); |
- if (factory_) |
- factory_->DatabaseDeleted(identifier_); |
+ factory_->DatabaseDeleted(identifier_); |
} |
void IndexedDBDatabase::ForceClose() { |
@@ -1713,12 +1710,7 @@ void IndexedDBDatabase::Close(IndexedDBConnection* connection, bool forced) { |
const GURL origin_url = backing_store_->origin_url(); |
backing_store_ = NULL; |
- // factory_ should only be null in unit tests. |
- // TODO(jsbell): DCHECK(factory_ || !in_unit_tests) - somehow. |
- if (factory_) { |
- factory_->ReleaseDatabase(identifier_, forced); |
- factory_ = NULL; |
- } |
+ factory_->ReleaseDatabase(identifier_, forced); |
} |
} |