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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 key_path = KeyPath::create().setType(KeyPath::TypeEnum::Array).build(); | 364 key_path = KeyPath::create().setType(KeyPath::TypeEnum::Array).build(); |
365 std::unique_ptr<protocol::Array<String>> array = | 365 std::unique_ptr<protocol::Array<String>> array = |
366 protocol::Array<String>::create(); | 366 protocol::Array<String>::create(); |
367 const Vector<String>& string_array = idb_key_path.Array(); | 367 const Vector<String>& string_array = idb_key_path.Array(); |
368 for (size_t i = 0; i < string_array.size(); ++i) | 368 for (size_t i = 0; i < string_array.size(); ++i) |
369 array->addItem(string_array[i]); | 369 array->addItem(string_array[i]); |
370 key_path->setArray(std::move(array)); | 370 key_path->setArray(std::move(array)); |
371 break; | 371 break; |
372 } | 372 } |
373 default: | 373 default: |
374 ASSERT_NOT_REACHED(); | 374 NOTREACHED(); |
375 } | 375 } |
376 | 376 |
377 return key_path; | 377 return key_path; |
378 } | 378 } |
379 | 379 |
380 class DatabaseLoader final | 380 class DatabaseLoader final |
381 : public ExecutableWithDatabase<RequestDatabaseCallback> { | 381 : public ExecutableWithDatabase<RequestDatabaseCallback> { |
382 public: | 382 public: |
383 static PassRefPtr<DatabaseLoader> Create( | 383 static PassRefPtr<DatabaseLoader> Create( |
384 ScriptState* script_state, | 384 ScriptState* script_state, |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 IDBObjectStore* idb_object_store = | 934 IDBObjectStore* idb_object_store = |
935 ObjectStoreForTransaction(idb_transaction, object_store_name_); | 935 ObjectStoreForTransaction(idb_transaction, object_store_name_); |
936 if (!idb_object_store) { | 936 if (!idb_object_store) { |
937 request_callback_->sendFailure( | 937 request_callback_->sendFailure( |
938 Response::Error("Could not get object store")); | 938 Response::Error("Could not get object store")); |
939 return; | 939 return; |
940 } | 940 } |
941 | 941 |
942 DummyExceptionStateForTesting exception_state; | 942 DummyExceptionStateForTesting exception_state; |
943 idb_object_store->clear(GetScriptState(), exception_state); | 943 idb_object_store->clear(GetScriptState(), exception_state); |
944 ASSERT(!exception_state.HadException()); | 944 DCHECK(!exception_state.HadException()); |
945 if (exception_state.HadException()) { | 945 if (exception_state.HadException()) { |
946 ExceptionCode ec = exception_state.Code(); | 946 ExceptionCode ec = exception_state.Code(); |
947 request_callback_->sendFailure(Response::Error( | 947 request_callback_->sendFailure(Response::Error( |
948 String::Format("Could not clear object store '%s': %d", | 948 String::Format("Could not clear object store '%s': %d", |
949 object_store_name_.Utf8().Data(), ec))); | 949 object_store_name_.Utf8().Data(), ec))); |
950 return; | 950 return; |
951 } | 951 } |
952 idb_transaction->addEventListener( | 952 idb_transaction->addEventListener( |
953 EventTypeNames::complete, | 953 EventTypeNames::complete, |
954 ClearObjectStoreListener::Create(std::move(request_callback_)), false); | 954 ClearObjectStoreListener::Create(std::move(request_callback_)), false); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 document->GetSecurityOrigin()->ToRawString()), | 1033 document->GetSecurityOrigin()->ToRawString()), |
1034 false); | 1034 false); |
1035 } | 1035 } |
1036 | 1036 |
1037 DEFINE_TRACE(InspectorIndexedDBAgent) { | 1037 DEFINE_TRACE(InspectorIndexedDBAgent) { |
1038 visitor->Trace(inspected_frames_); | 1038 visitor->Trace(inspected_frames_); |
1039 InspectorBaseAgent::Trace(visitor); | 1039 InspectorBaseAgent::Trace(visitor); |
1040 } | 1040 } |
1041 | 1041 |
1042 } // namespace blink | 1042 } // namespace blink |
OLD | NEW |