PBackgroundIDBCursor.ipdl (1940B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include protocol PBackgroundIDBTransaction; 6 include protocol PBackgroundIDBVersionChangeTransaction; 7 8 include PBackgroundIDBSharedTypes; 9 10 include "mozilla/dom/indexedDB/SerializationHelpers.h"; 11 include "mozilla/dom/indexedDB/ActorsChild.h"; 12 13 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; 14 15 using class mozilla::dom::indexedDB::Key 16 from "mozilla/dom/indexedDB/Key.h"; 17 18 namespace mozilla { 19 namespace dom { 20 namespace indexedDB { 21 22 struct ContinueParams 23 { 24 Key key; 25 }; 26 27 struct ContinuePrimaryKeyParams 28 { 29 Key key; 30 Key primaryKey; 31 }; 32 33 struct AdvanceParams 34 { 35 uint32_t count; 36 }; 37 38 union CursorRequestParams 39 { 40 ContinueParams; 41 ContinuePrimaryKeyParams; 42 AdvanceParams; 43 }; 44 45 struct ObjectStoreCursorResponse 46 { 47 Key key; 48 SerializedStructuredCloneReadInfo cloneInfo; 49 }; 50 51 struct ObjectStoreKeyCursorResponse 52 { 53 Key key; 54 }; 55 56 struct IndexCursorResponse 57 { 58 Key key; 59 Key sortKey; 60 Key objectKey; 61 SerializedStructuredCloneReadInfo cloneInfo; 62 }; 63 64 struct IndexKeyCursorResponse 65 { 66 Key key; 67 Key sortKey; 68 Key objectKey; 69 }; 70 71 // TODO: All cursor responses must be arrays! 72 union CursorResponse 73 { 74 void_t; 75 nsresult; 76 ObjectStoreCursorResponse[]; 77 ObjectStoreKeyCursorResponse[]; 78 IndexCursorResponse[]; 79 IndexKeyCursorResponse[]; 80 }; 81 82 [ChildImpl="indexedDB::BackgroundCursorChildBase", ParentImpl=virtual] 83 protocol PBackgroundIDBCursor 84 { 85 manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction; 86 87 parent: 88 async DeleteMe(); 89 90 async Continue(int64_t requestId, CursorRequestParams params, 91 Key currentKey, Key currentObjectStoreKey); 92 93 child: 94 async __delete__(); 95 96 async Response(CursorResponse response); 97 }; 98 99 } // namespace indexedDB 100 } // namespace dom 101 } // namespace mozilla