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 22 matching lines...) Expand all Loading... |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 34 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
36 #include "bindings/core/v8/ScriptState.h" | 36 #include "bindings/core/v8/ScriptState.h" |
37 #include "bindings/core/v8/V8PerIsolateData.h" | 37 #include "bindings/core/v8/V8PerIsolateData.h" |
38 #include "core/dom/DOMStringList.h" | 38 #include "core/dom/DOMStringList.h" |
39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
40 #include "core/events/EventListener.h" | 40 #include "core/events/EventListener.h" |
41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
42 #include "core/inspector/InspectedFrames.h" | 42 #include "core/inspector/InspectedFrames.h" |
| 43 #include "core/inspector/V8InspectorString.h" |
43 #include "modules/IndexedDBNames.h" | 44 #include "modules/IndexedDBNames.h" |
44 #include "modules/indexeddb/GlobalIndexedDB.h" | 45 #include "modules/indexeddb/GlobalIndexedDB.h" |
45 #include "modules/indexeddb/IDBCursor.h" | 46 #include "modules/indexeddb/IDBCursor.h" |
46 #include "modules/indexeddb/IDBCursorWithValue.h" | 47 #include "modules/indexeddb/IDBCursorWithValue.h" |
47 #include "modules/indexeddb/IDBDatabase.h" | 48 #include "modules/indexeddb/IDBDatabase.h" |
48 #include "modules/indexeddb/IDBFactory.h" | 49 #include "modules/indexeddb/IDBFactory.h" |
49 #include "modules/indexeddb/IDBIndex.h" | 50 #include "modules/indexeddb/IDBIndex.h" |
50 #include "modules/indexeddb/IDBKey.h" | 51 #include "modules/indexeddb/IDBKey.h" |
51 #include "modules/indexeddb/IDBKeyPath.h" | 52 #include "modules/indexeddb/IDBKeyPath.h" |
52 #include "modules/indexeddb/IDBKeyRange.h" | 53 #include "modules/indexeddb/IDBKeyRange.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 m_requestCallback->sendFailure("Could not continue cursor."); | 462 m_requestCallback->sendFailure("Could not continue cursor."); |
462 return; | 463 return; |
463 } | 464 } |
464 | 465 |
465 Document* document = toDocument(m_scriptState->getExecutionContext()); | 466 Document* document = toDocument(m_scriptState->getExecutionContext()); |
466 if (!document) | 467 if (!document) |
467 return; | 468 return; |
468 ScriptState* scriptState = m_scriptState.get(); | 469 ScriptState* scriptState = m_scriptState.get(); |
469 ScriptState::Scope scope(scriptState); | 470 ScriptState::Scope scope(scriptState); |
470 v8::Local<v8::Context> context = scriptState->context(); | 471 v8::Local<v8::Context> context = scriptState->context(); |
| 472 v8_inspector::StringView objectGroup = toV8InspectorStringView(indexedDB
ObjectGroup); |
471 std::unique_ptr<DataEntry> dataEntry = DataEntry::create() | 473 std::unique_ptr<DataEntry> dataEntry = DataEntry::create() |
472 .setKey(m_v8Session->wrapObject(context, idbCursor->key(scriptState)
.v8Value(), indexedDBObjectGroup)) | 474 .setKey(m_v8Session->wrapObject(context, idbCursor->key(scriptState)
.v8Value(), objectGroup)) |
473 .setPrimaryKey(m_v8Session->wrapObject(context, idbCursor->primaryKe
y(scriptState).v8Value(), indexedDBObjectGroup)) | 475 .setPrimaryKey(m_v8Session->wrapObject(context, idbCursor->primaryKe
y(scriptState).v8Value(), objectGroup)) |
474 .setValue(m_v8Session->wrapObject(context, idbCursor->value(scriptSt
ate).v8Value(), indexedDBObjectGroup)) | 476 .setValue(m_v8Session->wrapObject(context, idbCursor->value(scriptSt
ate).v8Value(), objectGroup)) |
475 .build(); | 477 .build(); |
476 m_result->addItem(std::move(dataEntry)); | 478 m_result->addItem(std::move(dataEntry)); |
477 } | 479 } |
478 | 480 |
479 void end(bool hasMore) | 481 void end(bool hasMore) |
480 { | 482 { |
481 m_requestCallback->sendSuccess(std::move(m_result), hasMore); | 483 m_requestCallback->sendSuccess(std::move(m_result), hasMore); |
482 } | 484 } |
483 | 485 |
484 DEFINE_INLINE_VIRTUAL_TRACE() | 486 DEFINE_INLINE_VIRTUAL_TRACE() |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 { | 585 { |
584 if (m_state->booleanProperty(IndexedDBAgentState::indexedDBAgentEnabled, fal
se)) { | 586 if (m_state->booleanProperty(IndexedDBAgentState::indexedDBAgentEnabled, fal
se)) { |
585 ErrorString error; | 587 ErrorString error; |
586 enable(&error); | 588 enable(&error); |
587 } | 589 } |
588 } | 590 } |
589 | 591 |
590 void InspectorIndexedDBAgent::didCommitLoadForLocalFrame(LocalFrame* frame) | 592 void InspectorIndexedDBAgent::didCommitLoadForLocalFrame(LocalFrame* frame) |
591 { | 593 { |
592 if (frame == m_inspectedFrames->root()) | 594 if (frame == m_inspectedFrames->root()) |
593 m_v8Session->releaseObjectGroup(indexedDBObjectGroup); | 595 m_v8Session->releaseObjectGroup(toV8InspectorStringView(indexedDBObjectG
roup)); |
594 } | 596 } |
595 | 597 |
596 void InspectorIndexedDBAgent::enable(ErrorString*) | 598 void InspectorIndexedDBAgent::enable(ErrorString*) |
597 { | 599 { |
598 m_state->setBoolean(IndexedDBAgentState::indexedDBAgentEnabled, true); | 600 m_state->setBoolean(IndexedDBAgentState::indexedDBAgentEnabled, true); |
599 } | 601 } |
600 | 602 |
601 void InspectorIndexedDBAgent::disable(ErrorString*) | 603 void InspectorIndexedDBAgent::disable(ErrorString*) |
602 { | 604 { |
603 m_state->setBoolean(IndexedDBAgentState::indexedDBAgentEnabled, false); | 605 m_state->setBoolean(IndexedDBAgentState::indexedDBAgentEnabled, false); |
604 m_v8Session->releaseObjectGroup(indexedDBObjectGroup); | 606 m_v8Session->releaseObjectGroup(toV8InspectorStringView(indexedDBObjectGroup
)); |
605 } | 607 } |
606 | 608 |
607 static Document* assertDocument(ErrorString* errorString, LocalFrame* frame) | 609 static Document* assertDocument(ErrorString* errorString, LocalFrame* frame) |
608 { | 610 { |
609 Document* document = frame ? frame->document() : nullptr; | 611 Document* document = frame ? frame->document() : nullptr; |
610 | 612 |
611 if (!document) | 613 if (!document) |
612 *errorString = "No document for given frame found"; | 614 *errorString = "No document for given frame found"; |
613 | 615 |
614 return document; | 616 return document; |
(...skipping 210 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 |