Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp

Issue 2642943002: Allow closing IndexedDB database before deleting (Closed)
Patch Set: Actually pass the flag Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
index 1b0b2f432ce63637ae7f3f0b57db0a721fc91026..a63b44766710066579eeedfe007a3692d17f67c7 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
@@ -152,6 +152,23 @@ IDBOpenDBRequest* IDBFactory::open(ScriptState* scriptState,
IDBOpenDBRequest* IDBFactory::deleteDatabase(ScriptState* scriptState,
const String& name,
ExceptionState& exceptionState) {
+ return deleteDatabaseInternal(scriptState, name, exceptionState,
+ false /* force_close */);
+}
+
+IDBOpenDBRequest* IDBFactory::closeConnectionsAndDeleteDatabase(
+ ScriptState* scriptState,
+ const String& name,
+ ExceptionState& exceptionState) {
+ return deleteDatabaseInternal(scriptState, name, exceptionState,
+ true /* force_close */);
+}
+
+IDBOpenDBRequest* IDBFactory::deleteDatabaseInternal(
+ ScriptState* scriptState,
+ const String& name,
+ ExceptionState& exceptionState,
+ bool forceClose) {
IDB_TRACE("IDBFactory::deleteDatabase");
IDBDatabase::recordApiCallsHistogram(IDBDeleteDatabaseCall);
if (!isContextValid(scriptState->getExecutionContext()))
@@ -177,7 +194,8 @@ IDBOpenDBRequest* IDBFactory::deleteDatabase(ScriptState* scriptState,
Platform::current()->idbFactory()->deleteDatabase(
name, request->createWebCallbacks().release(),
WebSecurityOrigin(
- scriptState->getExecutionContext()->getSecurityOrigin()));
+ scriptState->getExecutionContext()->getSecurityOrigin()),
+ forceClose);
return request;
}

Powered by Google App Engine
This is Rietveld 408576698