diff options
author | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 03:49:32 +0000 |
---|---|---|
committer | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-18 03:49:32 +0000 |
commit | 4fedd9ebdb7bb8f6b1b73d5292d5cf4b2312fcc8 (patch) | |
tree | bd829e5912794c2cdb7924baa0cfc3330ce62d27 /content | |
parent | 307ed044988af8233f0182e692c62911d353c5ec (diff) | |
download | chromium_src-4fedd9ebdb7bb8f6b1b73d5292d5cf4b2312fcc8.zip chromium_src-4fedd9ebdb7bb8f6b1b73d5292d5cf4b2312fcc8.tar.gz chromium_src-4fedd9ebdb7bb8f6b1b73d5292d5cf4b2312fcc8.tar.bz2 |
IndexedDB: Make deleteDatabase and getDatabaseNames close backing store
The fix in r239298 was insufficient and the test had an incorrect
expectation. Really-for-sure-this-time, when these IDBFactory methods
are called, don't retain the backing store.
BUG=325820
R=dgrogan,alecflett
Review URL: https://codereview.chromium.org/114303003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/indexed_db/indexed_db_factory.cc | 3 | ||||
-rw-r--r-- | content/browser/indexed_db/indexed_db_factory_unittest.cc | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc index 7be451f..1a83332 100644 --- a/content/browser/indexed_db/indexed_db_factory.cc +++ b/content/browser/indexed_db/indexed_db_factory.cc @@ -131,6 +131,7 @@ void IndexedDBFactory::GetDatabaseNames( } callbacks->OnSuccess(backing_store->GetDatabaseNames()); + backing_store = NULL; ReleaseBackingStore(origin_url, false /* immediate */); } @@ -182,6 +183,8 @@ void IndexedDBFactory::DeleteDatabase( database_map_[unique_identifier] = database; database->DeleteDatabase(callbacks); database_map_.erase(unique_identifier); + database = NULL; + backing_store = NULL; ReleaseBackingStore(origin_url, false /* immediate */); } diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc index 7d958e7..f99df63 100644 --- a/content/browser/indexed_db/indexed_db_factory_unittest.cc +++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc @@ -316,7 +316,7 @@ TEST_F(IndexedDBFactoryTest, DeleteDatabaseClosesBackingStore) { temp_directory.path()); EXPECT_TRUE(factory->IsBackingStoreOpen(origin)); - EXPECT_FALSE(factory->IsBackingStorePendingClose(origin)); + EXPECT_TRUE(factory->IsBackingStorePendingClose(origin)); // Now simulate shutdown, which should stop the timer. factory->ContextDestroyed(); @@ -342,7 +342,7 @@ TEST_F(IndexedDBFactoryTest, GetDatabaseNamesClosesBackingStore) { temp_directory.path()); EXPECT_TRUE(factory->IsBackingStoreOpen(origin)); - EXPECT_FALSE(factory->IsBackingStorePendingClose(origin)); + EXPECT_TRUE(factory->IsBackingStorePendingClose(origin)); // Now simulate shutdown, which should stop the timer. factory->ContextDestroyed(); |