| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 using blink::protocol::IndexedDB::KeyRange; | 69 using blink::protocol::IndexedDB::KeyRange; |
| 70 using blink::protocol::IndexedDB::ObjectStore; | 70 using blink::protocol::IndexedDB::ObjectStore; |
| 71 using blink::protocol::IndexedDB::ObjectStoreIndex; | 71 using blink::protocol::IndexedDB::ObjectStoreIndex; |
| 72 | 72 |
| 73 typedef blink::protocol::BackendCallback RequestCallback; | 73 typedef blink::protocol::BackendCallback RequestCallback; |
| 74 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseNamesCallback Reques
tDatabaseNamesCallback; | 74 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseNamesCallback Reques
tDatabaseNamesCallback; |
| 75 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseCallback RequestData
baseCallback; | 75 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseCallback RequestData
baseCallback; |
| 76 typedef blink::protocol::IndexedDB::Backend::RequestDataCallback RequestDataCall
back; | 76 typedef blink::protocol::IndexedDB::Backend::RequestDataCallback RequestDataCall
back; |
| 77 typedef blink::protocol::IndexedDB::Backend::ClearObjectStoreCallback ClearObjec
tStoreCallback; | 77 typedef blink::protocol::IndexedDB::Backend::ClearObjectStoreCallback ClearObjec
tStoreCallback; |
| 78 | 78 |
| 79 using indexed_db::mojom::blink::CursorDirection; |
| 80 |
| 79 namespace blink { | 81 namespace blink { |
| 80 | 82 |
| 81 namespace IndexedDBAgentState { | 83 namespace IndexedDBAgentState { |
| 82 static const char indexedDBAgentEnabled[] = "indexedDBAgentEnabled"; | 84 static const char indexedDBAgentEnabled[] = "indexedDBAgentEnabled"; |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 namespace { | 87 namespace { |
| 86 | 88 |
| 87 static const char indexedDBObjectGroup[] = "indexeddb"; | 89 static const char indexedDBObjectGroup[] = "indexeddb"; |
| 88 | 90 |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 } | 531 } |
| 530 | 532 |
| 531 IDBRequest* idbRequest; | 533 IDBRequest* idbRequest; |
| 532 if (!m_indexName.isEmpty()) { | 534 if (!m_indexName.isEmpty()) { |
| 533 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName
); | 535 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName
); |
| 534 if (!idbIndex) { | 536 if (!idbIndex) { |
| 535 m_requestCallback->sendFailure("Could not get index"); | 537 m_requestCallback->sendFailure("Could not get index"); |
| 536 return; | 538 return; |
| 537 } | 539 } |
| 538 | 540 |
| 539 idbRequest = idbIndex->openCursor(getScriptState(), m_idbKeyRange.ge
t(), WebIDBCursorDirectionNext); | 541 idbRequest = idbIndex->openCursor(getScriptState(), m_idbKeyRange.ge
t(), CursorDirection::Next); |
| 540 } else { | 542 } else { |
| 541 idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRa
nge.get(), WebIDBCursorDirectionNext); | 543 idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRa
nge.get(), CursorDirection::Next); |
| 542 } | 544 } |
| 543 OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(m_v8
Session, getScriptState(), std::move(m_requestCallback), m_skipCount, m_pageSize
); | 545 OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(m_v8
Session, getScriptState(), std::move(m_requestCallback), m_skipCount, m_pageSize
); |
| 544 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback
, false); | 546 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback
, false); |
| 545 } | 547 } |
| 546 | 548 |
| 547 RequestCallback* getRequestCallback() override { return m_requestCallback.ge
t(); } | 549 RequestCallback* getRequestCallback() override { return m_requestCallback.ge
t(); } |
| 548 DataLoader(v8_inspector::V8InspectorSession* v8Session, ScriptState* scriptS
tate, std::unique_ptr<RequestDataCallback> requestCallback, const String& object
StoreName, const String& indexName, IDBKeyRange* idbKeyRange, int skipCount, uns
igned pageSize) | 550 DataLoader(v8_inspector::V8InspectorSession* v8Session, ScriptState* scriptS
tate, std::unique_ptr<RequestDataCallback> requestCallback, const String& object
StoreName, const String& indexName, IDBKeyRange* idbKeyRange, int skipCount, uns
igned pageSize) |
| 549 : ExecutableWithDatabase(scriptState) | 551 : ExecutableWithDatabase(scriptState) |
| 550 , m_v8Session(v8Session) | 552 , m_v8Session(v8Session) |
| 551 , m_requestCallback(std::move(requestCallback)) | 553 , m_requestCallback(std::move(requestCallback)) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), databaseN
ame); | 827 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), databaseN
ame); |
| 826 } | 828 } |
| 827 | 829 |
| 828 DEFINE_TRACE(InspectorIndexedDBAgent) | 830 DEFINE_TRACE(InspectorIndexedDBAgent) |
| 829 { | 831 { |
| 830 visitor->trace(m_inspectedFrames); | 832 visitor->trace(m_inspectedFrames); |
| 831 InspectorBaseAgent::trace(visitor); | 833 InspectorBaseAgent::trace(visitor); |
| 832 } | 834 } |
| 833 | 835 |
| 834 } // namespace blink | 836 } // namespace blink |
| OLD | NEW |