| OLD | NEW |
| 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 Loading... |
| 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 DummyExceptionStateForTesting exception_state; | 783 IDBRequest* idb_request = idb_factory->GetDatabaseNames(script_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 } | |
| 791 idb_request->addEventListener( | 784 idb_request->addEventListener( |
| 792 EventTypeNames::success, | 785 EventTypeNames::success, |
| 793 GetDatabaseNamesCallback::Create( | 786 GetDatabaseNamesCallback::Create( |
| 794 std::move(request_callback), | 787 std::move(request_callback), |
| 795 document->GetSecurityOrigin()->ToRawString()), | 788 document->GetSecurityOrigin()->ToRawString()), |
| 796 false); | 789 false); |
| 797 } | 790 } |
| 798 | 791 |
| 799 void InspectorIndexedDBAgent::requestDatabase( | 792 void InspectorIndexedDBAgent::requestDatabase( |
| 800 const String& security_origin, | 793 const String& security_origin, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 request_callback->sendFailure(response); | 1007 request_callback->sendFailure(response); |
| 1015 return; | 1008 return; |
| 1016 } | 1009 } |
| 1017 | 1010 |
| 1018 ScriptState* script_state = ToScriptStateForMainWorld(frame); | 1011 ScriptState* script_state = ToScriptStateForMainWorld(frame); |
| 1019 if (!script_state) { | 1012 if (!script_state) { |
| 1020 request_callback->sendFailure(Response::InternalError()); | 1013 request_callback->sendFailure(Response::InternalError()); |
| 1021 return; | 1014 return; |
| 1022 } | 1015 } |
| 1023 ScriptState::Scope scope(script_state); | 1016 ScriptState::Scope scope(script_state); |
| 1024 DummyExceptionStateForTesting exception_state; | |
| 1025 IDBRequest* idb_request = idb_factory->CloseConnectionsAndDeleteDatabase( | 1017 IDBRequest* idb_request = idb_factory->CloseConnectionsAndDeleteDatabase( |
| 1026 script_state, database_name, exception_state); | 1018 script_state, database_name); |
| 1027 if (exception_state.HadException()) { | |
| 1028 request_callback->sendFailure( | |
| 1029 Response::Error("Could not delete database.")); | |
| 1030 return; | |
| 1031 } | |
| 1032 idb_request->addEventListener( | 1019 idb_request->addEventListener( |
| 1033 EventTypeNames::success, | 1020 EventTypeNames::success, |
| 1034 DeleteCallback::Create(std::move(request_callback), | 1021 DeleteCallback::Create(std::move(request_callback), |
| 1035 document->GetSecurityOrigin()->ToRawString()), | 1022 document->GetSecurityOrigin()->ToRawString()), |
| 1036 false); | 1023 false); |
| 1037 } | 1024 } |
| 1038 | 1025 |
| 1039 DEFINE_TRACE(InspectorIndexedDBAgent) { | 1026 DEFINE_TRACE(InspectorIndexedDBAgent) { |
| 1040 visitor->Trace(inspected_frames_); | 1027 visitor->Trace(inspected_frames_); |
| 1041 InspectorBaseAgent::Trace(visitor); | 1028 InspectorBaseAgent::Trace(visitor); |
| 1042 } | 1029 } |
| 1043 | 1030 |
| 1044 } // namespace blink | 1031 } // namespace blink |
| OLD | NEW |