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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 request_callback->sendFailure(response); 773 request_callback->sendFailure(response);
774 return; 774 return;
775 } 775 }
776 776
777 ScriptState* script_state = ToScriptStateForMainWorld(frame); 777 ScriptState* script_state = ToScriptStateForMainWorld(frame);
778 if (!script_state) { 778 if (!script_state) {
779 request_callback->sendFailure(Response::InternalError()); 779 request_callback->sendFailure(Response::InternalError());
780 return; 780 return;
781 } 781 }
782 ScriptState::Scope scope(script_state); 782 ScriptState::Scope scope(script_state);
783 IDBRequest* idb_request = idb_factory->GetDatabaseNames(script_state); 783 DummyExceptionStateForTesting exception_state;
784 IDBRequest* idb_request =
785 idb_factory->GetDatabaseNames(script_state, exception_state);
786 if (exception_state.HadException()) {
787 request_callback->sendFailure(
788 Response::Error("Could not obtain database names."));
789 return;
790 }
784 idb_request->addEventListener( 791 idb_request->addEventListener(
785 EventTypeNames::success, 792 EventTypeNames::success,
786 GetDatabaseNamesCallback::Create( 793 GetDatabaseNamesCallback::Create(
787 std::move(request_callback), 794 std::move(request_callback),
788 document->GetSecurityOrigin()->ToRawString()), 795 document->GetSecurityOrigin()->ToRawString()),
789 false); 796 false);
790 } 797 }
791 798
792 void InspectorIndexedDBAgent::requestDatabase( 799 void InspectorIndexedDBAgent::requestDatabase(
793 const String& security_origin, 800 const String& security_origin,
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 request_callback->sendFailure(response); 1014 request_callback->sendFailure(response);
1008 return; 1015 return;
1009 } 1016 }
1010 1017
1011 ScriptState* script_state = ToScriptStateForMainWorld(frame); 1018 ScriptState* script_state = ToScriptStateForMainWorld(frame);
1012 if (!script_state) { 1019 if (!script_state) {
1013 request_callback->sendFailure(Response::InternalError()); 1020 request_callback->sendFailure(Response::InternalError());
1014 return; 1021 return;
1015 } 1022 }
1016 ScriptState::Scope scope(script_state); 1023 ScriptState::Scope scope(script_state);
1024 DummyExceptionStateForTesting exception_state;
1017 IDBRequest* idb_request = idb_factory->CloseConnectionsAndDeleteDatabase( 1025 IDBRequest* idb_request = idb_factory->CloseConnectionsAndDeleteDatabase(
1018 script_state, database_name); 1026 script_state, database_name, exception_state);
1027 if (exception_state.HadException()) {
1028 request_callback->sendFailure(
1029 Response::Error("Could not delete database."));
1030 return;
1031 }
1019 idb_request->addEventListener( 1032 idb_request->addEventListener(
1020 EventTypeNames::success, 1033 EventTypeNames::success,
1021 DeleteCallback::Create(std::move(request_callback), 1034 DeleteCallback::Create(std::move(request_callback),
1022 document->GetSecurityOrigin()->ToRawString()), 1035 document->GetSecurityOrigin()->ToRawString()),
1023 false); 1036 false);
1024 } 1037 }
1025 1038
1026 DEFINE_TRACE(InspectorIndexedDBAgent) { 1039 DEFINE_TRACE(InspectorIndexedDBAgent) {
1027 visitor->Trace(inspected_frames_); 1040 visitor->Trace(inspected_frames_);
1028 InspectorBaseAgent::Trace(visitor); 1041 InspectorBaseAgent::Trace(visitor);
1029 } 1042 }
1030 1043
1031 } // namespace blink 1044 } // namespace blink
OLDNEW
« 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