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

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

Issue 2900863002: IndexedDB: Restore access checks in inspector-only IDBFactory methods (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index 3aeb5a49662e927a9fbabcaf9f9d78ffbed72c94..d6bba0057eb1f56418b06d61bd84f2eb6a384c52 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -780,7 +780,14 @@ void InspectorIndexedDBAgent::requestDatabaseNames(
return;
}
ScriptState::Scope scope(script_state);
- IDBRequest* idb_request = idb_factory->GetDatabaseNames(script_state);
+ DummyExceptionStateForTesting exception_state;
+ IDBRequest* idb_request =
+ idb_factory->GetDatabaseNames(script_state, exception_state);
+ if (exception_state.HadException()) {
+ request_callback->sendFailure(
+ Response::Error("Could not obtain database names."));
+ return;
+ }
idb_request->addEventListener(
EventTypeNames::success,
GetDatabaseNamesCallback::Create(
@@ -1014,8 +1021,14 @@ void InspectorIndexedDBAgent::deleteDatabase(
return;
}
ScriptState::Scope scope(script_state);
+ DummyExceptionStateForTesting exception_state;
IDBRequest* idb_request = idb_factory->CloseConnectionsAndDeleteDatabase(
- script_state, database_name);
+ script_state, database_name, exception_state);
+ if (exception_state.HadException()) {
+ request_callback->sendFailure(
+ Response::Error("Could not delete database."));
+ return;
+ }
idb_request->addEventListener(
EventTypeNames::success,
DeleteCallback::Create(std::move(request_callback),
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698