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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some (incomplete) work on struct traits. Created 4 years, 5 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
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 using blink::protocol::IndexedDB::KeyRange; 70 using blink::protocol::IndexedDB::KeyRange;
71 using blink::protocol::IndexedDB::ObjectStore; 71 using blink::protocol::IndexedDB::ObjectStore;
72 using blink::protocol::IndexedDB::ObjectStoreIndex; 72 using blink::protocol::IndexedDB::ObjectStoreIndex;
73 73
74 typedef blink::protocol::BackendCallback RequestCallback; 74 typedef blink::protocol::BackendCallback RequestCallback;
75 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseNamesCallback Reques tDatabaseNamesCallback; 75 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseNamesCallback Reques tDatabaseNamesCallback;
76 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseCallback RequestData baseCallback; 76 typedef blink::protocol::IndexedDB::Backend::RequestDatabaseCallback RequestData baseCallback;
77 typedef blink::protocol::IndexedDB::Backend::RequestDataCallback RequestDataCall back; 77 typedef blink::protocol::IndexedDB::Backend::RequestDataCallback RequestDataCall back;
78 typedef blink::protocol::IndexedDB::Backend::ClearObjectStoreCallback ClearObjec tStoreCallback; 78 typedef blink::protocol::IndexedDB::Backend::ClearObjectStoreCallback ClearObjec tStoreCallback;
79 79
80 using indexed_db::mojom::blink::CursorDirection;
81
80 namespace blink { 82 namespace blink {
81 83
82 namespace IndexedDBAgentState { 84 namespace IndexedDBAgentState {
83 static const char indexedDBAgentEnabled[] = "indexedDBAgentEnabled"; 85 static const char indexedDBAgentEnabled[] = "indexedDBAgentEnabled";
84 }; 86 };
85 87
86 namespace { 88 namespace {
87 89
88 class GetDatabaseNamesCallback final : public EventListener { 90 class GetDatabaseNamesCallback final : public EventListener {
89 WTF_MAKE_NONCOPYABLE(GetDatabaseNamesCallback); 91 WTF_MAKE_NONCOPYABLE(GetDatabaseNamesCallback);
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 } 535 }
534 536
535 IDBRequest* idbRequest; 537 IDBRequest* idbRequest;
536 if (!m_indexName.isEmpty()) { 538 if (!m_indexName.isEmpty()) {
537 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName ); 539 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName );
538 if (!idbIndex) { 540 if (!idbIndex) {
539 m_requestCallback->sendFailure("Could not get index"); 541 m_requestCallback->sendFailure("Could not get index");
540 return; 542 return;
541 } 543 }
542 544
543 idbRequest = idbIndex->openCursor(getScriptState(), m_idbKeyRange.ge t(), WebIDBCursorDirectionNext); 545 idbRequest = idbIndex->openCursor(getScriptState(), m_idbKeyRange.ge t(), CursorDirection::Next);
544 } else { 546 } else {
545 idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRa nge.get(), WebIDBCursorDirectionNext); 547 idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRa nge.get(), CursorDirection::Next);
546 } 548 }
547 OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(getS criptState(), std::move(m_requestCallback), m_skipCount, m_pageSize); 549 OpenCursorCallback* openCursorCallback = OpenCursorCallback::create(getS criptState(), std::move(m_requestCallback), m_skipCount, m_pageSize);
548 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback , false); 550 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback , false);
549 } 551 }
550 552
551 RequestCallback* getRequestCallback() override { return m_requestCallback.ge t(); } 553 RequestCallback* getRequestCallback() override { return m_requestCallback.ge t(); }
552 DataLoader(ScriptState* scriptState, std::unique_ptr<RequestDataCallback> re questCallback, const String& objectStoreName, const String& indexName, IDBKeyRan ge* idbKeyRange, int skipCount, unsigned pageSize) 554 DataLoader(ScriptState* scriptState, std::unique_ptr<RequestDataCallback> re questCallback, const String& objectStoreName, const String& indexName, IDBKeyRan ge* idbKeyRange, int skipCount, unsigned pageSize)
553 : ExecutableWithDatabase(scriptState) 555 : ExecutableWithDatabase(scriptState)
554 , m_requestCallback(std::move(requestCallback)) 556 , m_requestCallback(std::move(requestCallback))
555 , m_objectStoreName(objectStoreName) 557 , m_objectStoreName(objectStoreName)
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), databaseN ame); 806 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), databaseN ame);
805 } 807 }
806 808
807 DEFINE_TRACE(InspectorIndexedDBAgent) 809 DEFINE_TRACE(InspectorIndexedDBAgent)
808 { 810 {
809 visitor->trace(m_inspectedFrames); 811 visitor->trace(m_inspectedFrames);
810 InspectorBaseAgent::trace(visitor); 812 InspectorBaseAgent::trace(visitor);
811 } 813 }
812 814
813 } // namespace blink 815 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698