Source code

Revision control

Other Tools

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
include protocol PBackgroundMutableFile;
8
include protocol PChildToParentStream; // FIXME: bug 792908
9
include protocol PFileDescriptorSet; // FIXME: bug 792908
10
include protocol PIPCBlobInputStream; // FIXME: bug 792908
11
include protocol PParentToChildStream; // FIXME: bug 792908
12
13
include PBackgroundIDBSharedTypes;
14
15
include "mozilla/dom/indexedDB/SerializationHelpers.h";
16
17
using struct mozilla::void_t
18
from "ipc/IPCMessageUtils.h";
19
20
using class mozilla::dom::indexedDB::Key
21
from "mozilla/dom/indexedDB/Key.h";
22
23
namespace mozilla {
24
namespace dom {
25
namespace indexedDB {
26
27
struct ObjectStoreAddResponse
28
{
29
Key key;
30
};
31
32
struct ObjectStorePutResponse
33
{
34
Key key;
35
};
36
37
struct ObjectStoreGetResponse
38
{
39
SerializedStructuredCloneReadInfo cloneInfo;
40
};
41
42
struct ObjectStoreGetKeyResponse
43
{
44
Key key;
45
};
46
47
struct ObjectStoreGetAllResponse
48
{
49
SerializedStructuredCloneReadInfo[] cloneInfos;
50
};
51
52
struct ObjectStoreGetAllKeysResponse
53
{
54
Key[] keys;
55
};
56
57
struct ObjectStoreDeleteResponse
58
{ };
59
60
struct ObjectStoreClearResponse
61
{ };
62
63
struct ObjectStoreCountResponse
64
{
65
uint64_t count;
66
};
67
68
struct IndexGetResponse
69
{
70
SerializedStructuredCloneReadInfo cloneInfo;
71
};
72
73
struct IndexGetKeyResponse
74
{
75
Key key;
76
};
77
78
struct IndexGetAllResponse
79
{
80
SerializedStructuredCloneReadInfo[] cloneInfos;
81
};
82
83
struct IndexGetAllKeysResponse
84
{
85
Key[] keys;
86
};
87
88
struct IndexCountResponse
89
{
90
uint64_t count;
91
};
92
93
union RequestResponse
94
{
95
nsresult;
96
ObjectStoreGetResponse;
97
ObjectStoreGetKeyResponse;
98
ObjectStoreAddResponse;
99
ObjectStorePutResponse;
100
ObjectStoreDeleteResponse;
101
ObjectStoreClearResponse;
102
ObjectStoreCountResponse;
103
ObjectStoreGetAllResponse;
104
ObjectStoreGetAllKeysResponse;
105
IndexGetResponse;
106
IndexGetKeyResponse;
107
IndexGetAllResponse;
108
IndexGetAllKeysResponse;
109
IndexCountResponse;
110
};
111
112
struct PreprocessInfo
113
{
114
SerializedStructuredCloneFile[] files;
115
};
116
117
struct ObjectStoreGetPreprocessParams
118
{
119
PreprocessInfo preprocessInfo;
120
};
121
122
struct ObjectStoreGetAllPreprocessParams
123
{
124
PreprocessInfo[] preprocessInfos;
125
};
126
127
union PreprocessParams
128
{
129
ObjectStoreGetPreprocessParams;
130
ObjectStoreGetAllPreprocessParams;
131
};
132
133
struct ObjectStoreGetPreprocessResponse
134
{
135
};
136
137
struct ObjectStoreGetAllPreprocessResponse
138
{
139
};
140
141
// The nsresult is used if an error occurs for any preprocess request type.
142
// The specific response types are sent on success.
143
union PreprocessResponse
144
{
145
nsresult;
146
ObjectStoreGetPreprocessResponse;
147
ObjectStoreGetAllPreprocessResponse;
148
};
149
150
protocol PBackgroundIDBRequest
151
{
152
manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
153
154
parent:
155
async Continue(PreprocessResponse response);
156
157
child:
158
async __delete__(RequestResponse response);
159
160
// Preprocess is used in cases where response processing needs to do something
161
// asynchronous off of the child actor's thread before returning the actual
162
// result to user code. This is necessary because RequestResponse processing
163
// occurs in __delete__ and the PBackgroundIDBRequest implementations'
164
// life-cycles are controlled by IPC and are not otherwise reference counted.
165
// By introducing the (optional) Preprocess/Continue steps reference counting
166
// or the introduction of additional runnables are avoided.
167
async Preprocess(PreprocessParams params);
168
};
169
170
} // namespace indexedDB
171
} // namespace dom
172
} // namespace mozilla