Commit 66c83b1f authored by jyasskin's avatar jyasskin Committed by Commit bot

Revert of Optimizes the operation of DeleteDatabase when no backing store...

Revert of Optimizes the operation of DeleteDatabase when no backing store exists. (patchset #5 id:120001 of https://codereview.chromium.org/1071553002/)

Reason for revert:
This appears to have made IndexedDBBrowserTest.DiskFullOnCommit flaky, starting at http://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Content%20Browser%20%28DrMemory%20full%29%20%286%29/builds/380

[ RUN      ] IndexedDBBrowserTest.DiskFullOnCommit

[1028:1768:0423/085845:4229748:INFO:mock_browsertest_indexed_db_class_factory.cc(258)] FailOperation: class=2, method=2, instanceNum=5, callNum=1
[1028:1768:0423/085845:4229873:INFO:indexed_db_browsertest.cc(77)] Navigating to URL and blocking.
[3872:2724:0423/085859:4243383:ERROR:renderer_main.cc(200)] Running without renderer sandbox

[1028:1096:0423/085958:4302491:ERROR:indexed_db_backing_store.cc(4197)] IndexedDB Write Error: TRANSACTION_COMMIT_METHOD
[1028:1768:0423/090005:4309621:INFO:indexed_db_browsertest.cc(79)] Navigation done.
c:\b\build\slave\drm-cr\build\src\content\browser\indexed_db\indexed_db_browsertest.cc(88): error: Failed
Failed: Starting...<span>FAILED: unexpectedErrorCallback<br></span>
[  FAILED  ] IndexedDBBrowserTest.DiskFullOnCommit, where TypeParam =  and GetParam() =  (130664 ms)

Original issue's description:
> Optimizes the operation of DeleteDatabase when no backing store exists.
>
> When deleting the non existing database in a origin with no existing
> backing store, then in DeleteDatabse(), early exiting before OpenBackingStore,
> so that it wont results in multiple transaction as earlier.
>
> BUG=460236
>
> Committed: https://crrev.com/a4c618a142515773709688bfe3c5753e589afd43
> Cr-Commit-Position: refs/heads/master@{#326473}

TBR=cmumford@chromium.org,jsbell@chromium.org,payal.pandey@samsung.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=460236

Review URL: https://codereview.chromium.org/1106703003

Cr-Commit-Position: refs/heads/master@{#326686}
parent 7cd6bb4c
......@@ -492,14 +492,22 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) {
// => IndexedDBBackingStore::SetUpMetadata
// #2: IndexedDBBackingStore::OpenBackingStore
// => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
// * Then deletes the database:
// #3: IndexedDBFactoryImpl::DeleteDatabase
// => IndexedDBDatabase::Create
// => IndexedDBBackingStore::CreateIDBDatabaseMetaData
// #4: IndexedDBFactoryImpl::DeleteDatabase
// => IndexedDBDatabase::DeleteDatabase
// => IndexedDBBackingStore::DeleteDatabase
// => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
// * The test calls open(), to create a new database:
// #3: IndexedDBFactoryImpl::Open
// #5: IndexedDBFactoryImpl::Open
// => IndexedDBDatabase::Create
// => IndexedDBBackingStore::CreateIDBDatabaseMetaData
// #4: IndexedDBTransaction::Commit - initial "versionchange" transaction
// #6: IndexedDBTransaction::Commit - initial "versionchange" transaction
// * Once the connection is opened, the test runs:
// #5: IndexedDBTransaction::Commit - the test's "readwrite" transaction)
const int instance_num = 5;
// #7: IndexedDBTransaction::Commit - the test's "readwrite" transaction)
const int instance_num = 7;
const int call_num = 1;
FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL,
instance_num, call_num);
......
......@@ -257,26 +257,6 @@ void IndexedDBFactoryImpl::DeleteDatabase(
return;
}
std::vector<base::string16> names = backing_store->GetDatabaseNames(&s);
if (!s.ok()) {
DLOG(ERROR) << "Internal error getting database names";
IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError,
"Internal error opening backing store for "
"indexedDB.deleteDatabase.");
callbacks->OnError(error);
backing_store = NULL;
if (s.IsCorruption())
HandleBackingStoreCorruption(origin_url, error);
return;
}
if (!ContainsValue(names, name)) {
const int64 version = 0;
callbacks->OnSuccess(version);
backing_store = NULL;
ReleaseBackingStore(origin_url, false /* immediate */);
return;
}
scoped_refptr<IndexedDBDatabase> database = IndexedDBDatabase::Create(
name, backing_store.get(), this, unique_identifier, &s);
if (!database.get()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment