/work/obj-fuzz/ipc/ipdl/PBackgroundLocalStorageCacheChild.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/dom/PBackgroundLocalStorageCacheChild.h" |
8 | | |
9 | | #include "mozilla/ipc/PBackgroundChild.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | |
18 | | auto PBackgroundLocalStorageCacheChild::Recv__delete__() -> mozilla::ipc::IPCResult |
19 | 0 | { |
20 | 0 | return IPC_OK(); |
21 | 0 | } |
22 | | |
23 | | auto PBackgroundLocalStorageCacheChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | MOZ_IMPLICIT PBackgroundLocalStorageCacheChild::PBackgroundLocalStorageCacheChild() : |
28 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
29 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
30 | 0 | { |
31 | 0 | MOZ_COUNT_CTOR(PBackgroundLocalStorageCacheChild); |
32 | 0 | } |
33 | | |
34 | | PBackgroundLocalStorageCacheChild::~PBackgroundLocalStorageCacheChild() |
35 | 0 | { |
36 | 0 | MOZ_COUNT_DTOR(PBackgroundLocalStorageCacheChild); |
37 | 0 | } |
38 | | |
39 | | auto PBackgroundLocalStorageCacheChild::Manager() const -> PBackgroundChild* |
40 | 0 | { |
41 | 0 | return static_cast<PBackgroundChild*>(IProtocol::Manager()); |
42 | 0 | } |
43 | | |
44 | | auto PBackgroundLocalStorageCacheChild::SendDeleteMe() -> bool |
45 | 0 | { |
46 | 0 | IPC::Message* msg__ = PBackgroundLocalStorageCache::Msg_DeleteMe(Id()); |
47 | 0 |
|
48 | 0 |
|
49 | 0 |
|
50 | 0 |
|
51 | 0 |
|
52 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheChild")) { |
53 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
54 | 0 | } |
55 | 0 | AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_DeleteMe", OTHER); |
56 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
57 | 0 | mozilla::ipc::LogicError("Transition error"); |
58 | 0 | } |
59 | 0 |
|
60 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
61 | 0 | return sendok__; |
62 | 0 | } |
63 | | |
64 | | auto PBackgroundLocalStorageCacheChild::SendNotify( |
65 | | const nsString& documentURI, |
66 | | const nsString& key, |
67 | | const nsString& oldValue, |
68 | | const nsString& newValue) -> bool |
69 | 0 | { |
70 | 0 | IPC::Message* msg__ = PBackgroundLocalStorageCache::Msg_Notify(Id()); |
71 | 0 |
|
72 | 0 | WriteIPDLParam(msg__, this, documentURI); |
73 | 0 | // Sentinel = 'documentURI' |
74 | 0 | (msg__)->WriteSentinel(3585823520); |
75 | 0 | WriteIPDLParam(msg__, this, key); |
76 | 0 | // Sentinel = 'key' |
77 | 0 | (msg__)->WriteSentinel(35142870); |
78 | 0 | WriteIPDLParam(msg__, this, oldValue); |
79 | 0 | // Sentinel = 'oldValue' |
80 | 0 | (msg__)->WriteSentinel(2227149046); |
81 | 0 | WriteIPDLParam(msg__, this, newValue); |
82 | 0 | // Sentinel = 'newValue' |
83 | 0 | (msg__)->WriteSentinel(1405873629); |
84 | 0 |
|
85 | 0 |
|
86 | 0 |
|
87 | 0 |
|
88 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheChild")) { |
89 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
90 | 0 | } |
91 | 0 | AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_Notify", OTHER); |
92 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
93 | 0 | mozilla::ipc::LogicError("Transition error"); |
94 | 0 | } |
95 | 0 |
|
96 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
97 | 0 | return sendok__; |
98 | 0 | } |
99 | | |
100 | | auto PBackgroundLocalStorageCacheChild::RemoveManagee( |
101 | | int32_t aProtocolId, |
102 | | IProtocol* aListener) -> void |
103 | 0 | { |
104 | 0 | FatalError("unreached"); |
105 | 0 | return; |
106 | 0 | } |
107 | | |
108 | | auto PBackgroundLocalStorageCacheChild::OnMessageReceived(const Message& msg__) -> PBackgroundLocalStorageCacheChild::Result |
109 | 0 | { |
110 | 0 | switch ((msg__).type()) { |
111 | 0 | case PBackgroundLocalStorageCache::Msg_Observe__ID: |
112 | 0 | { |
113 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheChild")) { |
114 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
115 | 0 | } |
116 | 0 | AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg_Observe", OTHER); |
117 | 0 |
|
118 | 0 | PickleIterator iter__(msg__); |
119 | 0 | PrincipalInfo principalInfo; |
120 | 0 | uint32_t privateBrowsingId; |
121 | 0 | nsString documentURI; |
122 | 0 | nsString key; |
123 | 0 | nsString oldValue; |
124 | 0 | nsString newValue; |
125 | 0 |
|
126 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(principalInfo)))))) { |
127 | 0 | FatalError("Error deserializing 'PrincipalInfo'"); |
128 | 0 | return MsgValueError; |
129 | 0 | } |
130 | 0 | // Sentinel = 'principalInfo' |
131 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3386633731)))) { |
132 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PrincipalInfo'"); |
133 | 0 | return MsgValueError; |
134 | 0 | } |
135 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(privateBrowsingId)))))) { |
136 | 0 | FatalError("Error deserializing 'uint32_t'"); |
137 | 0 | return MsgValueError; |
138 | 0 | } |
139 | 0 | // Sentinel = 'privateBrowsingId' |
140 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2950341020)))) { |
141 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
142 | 0 | return MsgValueError; |
143 | 0 | } |
144 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(documentURI)))))) { |
145 | 0 | FatalError("Error deserializing 'nsString'"); |
146 | 0 | return MsgValueError; |
147 | 0 | } |
148 | 0 | // Sentinel = 'documentURI' |
149 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3585823520)))) { |
150 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
151 | 0 | return MsgValueError; |
152 | 0 | } |
153 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(key)))))) { |
154 | 0 | FatalError("Error deserializing 'nsString'"); |
155 | 0 | return MsgValueError; |
156 | 0 | } |
157 | 0 | // Sentinel = 'key' |
158 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 35142870)))) { |
159 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
160 | 0 | return MsgValueError; |
161 | 0 | } |
162 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(oldValue)))))) { |
163 | 0 | FatalError("Error deserializing 'nsString'"); |
164 | 0 | return MsgValueError; |
165 | 0 | } |
166 | 0 | // Sentinel = 'oldValue' |
167 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2227149046)))) { |
168 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
169 | 0 | return MsgValueError; |
170 | 0 | } |
171 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(newValue)))))) { |
172 | 0 | FatalError("Error deserializing 'nsString'"); |
173 | 0 | return MsgValueError; |
174 | 0 | } |
175 | 0 | // Sentinel = 'newValue' |
176 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1405873629)))) { |
177 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
178 | 0 | return MsgValueError; |
179 | 0 | } |
180 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
181 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
182 | 0 | FatalError("Transition error"); |
183 | 0 | return MsgValueError; |
184 | 0 | } |
185 | 0 | if ((!(RecvObserve(principalInfo, privateBrowsingId, documentURI, key, oldValue, newValue)))) { |
186 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
187 | 0 | // Error handled in mozilla::ipc::IPCResult |
188 | 0 | return MsgProcessingError; |
189 | 0 | } |
190 | 0 | |
191 | 0 | return MsgProcessed; |
192 | 0 | } |
193 | 0 | case PBackgroundLocalStorageCache::Msg___delete____ID: |
194 | 0 | { |
195 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundLocalStorageCacheChild")) { |
196 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundLocalStorageCacheChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
197 | 0 | } |
198 | 0 | AUTO_PROFILER_LABEL("PBackgroundLocalStorageCache::Msg___delete__", OTHER); |
199 | 0 |
|
200 | 0 | PickleIterator iter__(msg__); |
201 | 0 | PBackgroundLocalStorageCacheChild* actor; |
202 | 0 |
|
203 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
204 | 0 | FatalError("Error deserializing 'PBackgroundLocalStorageCacheChild'"); |
205 | 0 | return MsgValueError; |
206 | 0 | } |
207 | 0 | if ((!((*((&(actor))))))) { |
208 | 0 | FatalError("Error deserializing 'PBackgroundLocalStorageCacheChild'"); |
209 | 0 | return MsgValueError; |
210 | 0 | } |
211 | 0 | // Sentinel = 'actor' |
212 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
213 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBackgroundLocalStorageCacheChild'"); |
214 | 0 | return MsgValueError; |
215 | 0 | } |
216 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
217 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
218 | 0 | FatalError("Transition error"); |
219 | 0 | return MsgValueError; |
220 | 0 | } |
221 | 0 | if ((!(Recv__delete__()))) { |
222 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
223 | 0 | // Error handled in mozilla::ipc::IPCResult |
224 | 0 | return MsgProcessingError; |
225 | 0 | } |
226 | 0 | |
227 | 0 | |
228 | 0 | IProtocol* mgr = (actor)->Manager(); |
229 | 0 | (actor)->DestroySubtree(Deletion); |
230 | 0 | (actor)->DeallocSubtree(); |
231 | 0 | (mgr)->RemoveManagee(PBackgroundLocalStorageCacheMsgStart, actor); |
232 | 0 |
|
233 | 0 | return MsgProcessed; |
234 | 0 | } |
235 | 0 | default: |
236 | 0 | { |
237 | 0 | return MsgNotKnown; |
238 | 0 | } |
239 | 0 | } |
240 | 0 | } |
241 | | |
242 | | auto PBackgroundLocalStorageCacheChild::OnMessageReceived( |
243 | | const Message& msg__, |
244 | | Message*& reply__) -> PBackgroundLocalStorageCacheChild::Result |
245 | 0 | { |
246 | 0 | return MsgNotKnown; |
247 | 0 | } |
248 | | |
249 | | auto PBackgroundLocalStorageCacheChild::OnCallReceived( |
250 | | const Message& msg__, |
251 | | Message*& reply__) -> PBackgroundLocalStorageCacheChild::Result |
252 | 0 | { |
253 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
254 | 0 | return MsgNotKnown; |
255 | 0 | } |
256 | | |
257 | | auto PBackgroundLocalStorageCacheChild::GetProtocolTypeId() -> int32_t |
258 | 0 | { |
259 | 0 | return PBackgroundLocalStorageCacheMsgStart; |
260 | 0 | } |
261 | | |
262 | | auto PBackgroundLocalStorageCacheChild::DestroySubtree(ActorDestroyReason why) -> void |
263 | 0 | { |
264 | 0 | // Unregister from our manager. |
265 | 0 | Unregister(Id()); |
266 | 0 |
|
267 | 0 | // Reject owning pending responses. |
268 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
269 | 0 |
|
270 | 0 | // Finally, destroy "us". |
271 | 0 | ActorDestroy(why); |
272 | 0 | } |
273 | | |
274 | | auto PBackgroundLocalStorageCacheChild::DeallocSubtree() -> void |
275 | 0 | { |
276 | 0 | } |
277 | | |
278 | | |
279 | | |
280 | | } // namespace dom |
281 | | } // namespace mozilla |
282 | | namespace mozilla { |
283 | | namespace ipc { |
284 | | auto IPDLParamTraits<mozilla::dom::PBackgroundLocalStorageCacheChild>::Write( |
285 | | IPC::Message* aMsg, |
286 | | mozilla::ipc::IProtocol* aActor, |
287 | | const paramType& aVar) -> void |
288 | 0 | { |
289 | 0 | int32_t id; |
290 | 0 | if ((!(aVar))) { |
291 | 0 | id = 0; |
292 | 0 | } |
293 | 0 | else { |
294 | 0 | id = (aVar)->Id(); |
295 | 0 | if ((1) == (id)) { |
296 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
297 | 0 | } |
298 | 0 | } |
299 | 0 | WriteIPDLParam(aMsg, aActor, id); |
300 | 0 | } |
301 | | |
302 | | auto IPDLParamTraits<mozilla::dom::PBackgroundLocalStorageCacheChild>::Read( |
303 | | const IPC::Message* aMsg, |
304 | | PickleIterator* aIter, |
305 | | mozilla::ipc::IProtocol* aActor, |
306 | | paramType* aVar) -> bool |
307 | 0 | { |
308 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PBackgroundLocalStorageCache", PBackgroundLocalStorageCacheMsgStart); |
309 | 0 | if ((actor).isNothing()) { |
310 | 0 | return false; |
311 | 0 | } |
312 | 0 | |
313 | 0 | (*(aVar)) = static_cast<mozilla::dom::PBackgroundLocalStorageCacheChild*>((actor).value()); |
314 | 0 | return true; |
315 | 0 | } |
316 | | |
317 | | } // namespace ipc |
318 | | } // namespace mozilla |