/work/obj-fuzz/ipc/ipdl/PBackgroundIDBRequestChild.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/indexedDB/PBackgroundIDBRequestChild.h" |
8 | | #include "ipc/IPCMessageUtils.h" |
9 | | #include "mozilla/dom/indexedDB/Key.h" |
10 | | |
11 | | #include "mozilla/dom/indexedDB/PBackgroundIDBTransactionChild.h" |
12 | | #include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransactionChild.h" |
13 | | #include "mozilla/dom/PBackgroundMutableFileChild.h" |
14 | | #include "mozilla/ipc/PChildToParentStreamChild.h" |
15 | | #include "mozilla/ipc/PFileDescriptorSetChild.h" |
16 | | #include "mozilla/ipc/PIPCBlobInputStreamChild.h" |
17 | | #include "mozilla/ipc/PParentToChildStreamChild.h" |
18 | | |
19 | | #include "nsIFile.h" |
20 | | #include "GeckoProfiler.h" |
21 | | |
22 | | namespace mozilla { |
23 | | namespace dom { |
24 | | namespace indexedDB { |
25 | | |
26 | | |
27 | | auto PBackgroundIDBRequestChild::Recv__delete__(const RequestResponse& response) -> mozilla::ipc::IPCResult |
28 | 0 | { |
29 | 0 | return IPC_OK(); |
30 | 0 | } |
31 | | |
32 | | auto PBackgroundIDBRequestChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
33 | 0 | { |
34 | 0 | } |
35 | | |
36 | | MOZ_IMPLICIT PBackgroundIDBRequestChild::PBackgroundIDBRequestChild() : |
37 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
38 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
39 | 0 | { |
40 | 0 | MOZ_COUNT_CTOR(PBackgroundIDBRequestChild); |
41 | 0 | } |
42 | | |
43 | | PBackgroundIDBRequestChild::~PBackgroundIDBRequestChild() |
44 | 0 | { |
45 | 0 | MOZ_COUNT_DTOR(PBackgroundIDBRequestChild); |
46 | 0 | } |
47 | | |
48 | | auto PBackgroundIDBRequestChild::SendContinue(const PreprocessResponse& response) -> bool |
49 | 0 | { |
50 | 0 | IPC::Message* msg__ = PBackgroundIDBRequest::Msg_Continue(Id()); |
51 | 0 |
|
52 | 0 | WriteIPDLParam(msg__, this, response); |
53 | 0 | // Sentinel = 'response' |
54 | 0 | (msg__)->WriteSentinel(2396115421); |
55 | 0 |
|
56 | 0 |
|
57 | 0 |
|
58 | 0 |
|
59 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBRequestChild")) { |
60 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBRequestChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
61 | 0 | } |
62 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBRequest::Msg_Continue", OTHER); |
63 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
64 | 0 | mozilla::ipc::LogicError("Transition error"); |
65 | 0 | } |
66 | 0 |
|
67 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
68 | 0 | return sendok__; |
69 | 0 | } |
70 | | |
71 | | auto PBackgroundIDBRequestChild::RemoveManagee( |
72 | | int32_t aProtocolId, |
73 | | IProtocol* aListener) -> void |
74 | 0 | { |
75 | 0 | FatalError("unreached"); |
76 | 0 | return; |
77 | 0 | } |
78 | | |
79 | | auto PBackgroundIDBRequestChild::OnMessageReceived(const Message& msg__) -> PBackgroundIDBRequestChild::Result |
80 | 0 | { |
81 | 0 | switch ((msg__).type()) { |
82 | 0 | case PBackgroundIDBRequest::Msg___delete____ID: |
83 | 0 | { |
84 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBRequestChild")) { |
85 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
86 | 0 | } |
87 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBRequest::Msg___delete__", OTHER); |
88 | 0 |
|
89 | 0 | PickleIterator iter__(msg__); |
90 | 0 | PBackgroundIDBRequestChild* actor; |
91 | 0 | RequestResponse response; |
92 | 0 |
|
93 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
94 | 0 | FatalError("Error deserializing 'PBackgroundIDBRequestChild'"); |
95 | 0 | return MsgValueError; |
96 | 0 | } |
97 | 0 | if ((!((*((&(actor))))))) { |
98 | 0 | FatalError("Error deserializing 'PBackgroundIDBRequestChild'"); |
99 | 0 | return MsgValueError; |
100 | 0 | } |
101 | 0 | // Sentinel = 'actor' |
102 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
103 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBackgroundIDBRequestChild'"); |
104 | 0 | return MsgValueError; |
105 | 0 | } |
106 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(response)))))) { |
107 | 0 | FatalError("Error deserializing 'RequestResponse'"); |
108 | 0 | return MsgValueError; |
109 | 0 | } |
110 | 0 | // Sentinel = 'response' |
111 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2396115421)))) { |
112 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'RequestResponse'"); |
113 | 0 | return MsgValueError; |
114 | 0 | } |
115 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
116 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
117 | 0 | FatalError("Transition error"); |
118 | 0 | return MsgValueError; |
119 | 0 | } |
120 | 0 | if ((!(Recv__delete__(response)))) { |
121 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
122 | 0 | // Error handled in mozilla::ipc::IPCResult |
123 | 0 | return MsgProcessingError; |
124 | 0 | } |
125 | 0 | |
126 | 0 | |
127 | 0 | IProtocol* mgr = (actor)->Manager(); |
128 | 0 | (actor)->DestroySubtree(Deletion); |
129 | 0 | (actor)->DeallocSubtree(); |
130 | 0 | (mgr)->RemoveManagee(PBackgroundIDBRequestMsgStart, actor); |
131 | 0 |
|
132 | 0 | return MsgProcessed; |
133 | 0 | } |
134 | 0 | case PBackgroundIDBRequest::Msg_Preprocess__ID: |
135 | 0 | { |
136 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBRequestChild")) { |
137 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
138 | 0 | } |
139 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBRequest::Msg_Preprocess", OTHER); |
140 | 0 |
|
141 | 0 | PickleIterator iter__(msg__); |
142 | 0 | PreprocessParams params; |
143 | 0 |
|
144 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(params)))))) { |
145 | 0 | FatalError("Error deserializing 'PreprocessParams'"); |
146 | 0 | return MsgValueError; |
147 | 0 | } |
148 | 0 | // Sentinel = 'params' |
149 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1677790004)))) { |
150 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PreprocessParams'"); |
151 | 0 | return MsgValueError; |
152 | 0 | } |
153 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
154 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
155 | 0 | FatalError("Transition error"); |
156 | 0 | return MsgValueError; |
157 | 0 | } |
158 | 0 | if ((!(RecvPreprocess(params)))) { |
159 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
160 | 0 | // Error handled in mozilla::ipc::IPCResult |
161 | 0 | return MsgProcessingError; |
162 | 0 | } |
163 | 0 | |
164 | 0 | return MsgProcessed; |
165 | 0 | } |
166 | 0 | default: |
167 | 0 | { |
168 | 0 | return MsgNotKnown; |
169 | 0 | } |
170 | 0 | } |
171 | 0 | } |
172 | | |
173 | | auto PBackgroundIDBRequestChild::OnMessageReceived( |
174 | | const Message& msg__, |
175 | | Message*& reply__) -> PBackgroundIDBRequestChild::Result |
176 | 0 | { |
177 | 0 | return MsgNotKnown; |
178 | 0 | } |
179 | | |
180 | | auto PBackgroundIDBRequestChild::OnCallReceived( |
181 | | const Message& msg__, |
182 | | Message*& reply__) -> PBackgroundIDBRequestChild::Result |
183 | 0 | { |
184 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
185 | 0 | return MsgNotKnown; |
186 | 0 | } |
187 | | |
188 | | auto PBackgroundIDBRequestChild::GetProtocolTypeId() -> int32_t |
189 | 0 | { |
190 | 0 | return PBackgroundIDBRequestMsgStart; |
191 | 0 | } |
192 | | |
193 | | auto PBackgroundIDBRequestChild::DestroySubtree(ActorDestroyReason why) -> void |
194 | 0 | { |
195 | 0 | // Unregister from our manager. |
196 | 0 | Unregister(Id()); |
197 | 0 |
|
198 | 0 | // Reject owning pending responses. |
199 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
200 | 0 |
|
201 | 0 | // Finally, destroy "us". |
202 | 0 | ActorDestroy(why); |
203 | 0 | } |
204 | | |
205 | | auto PBackgroundIDBRequestChild::DeallocSubtree() -> void |
206 | 0 | { |
207 | 0 | } |
208 | | |
209 | | |
210 | | |
211 | | } // namespace indexedDB |
212 | | } // namespace dom |
213 | | } // namespace mozilla |
214 | | namespace mozilla { |
215 | | namespace ipc { |
216 | | auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBRequestChild>::Write( |
217 | | IPC::Message* aMsg, |
218 | | mozilla::ipc::IProtocol* aActor, |
219 | | const paramType& aVar) -> void |
220 | 0 | { |
221 | 0 | int32_t id; |
222 | 0 | if ((!(aVar))) { |
223 | 0 | id = 0; |
224 | 0 | } |
225 | 0 | else { |
226 | 0 | id = (aVar)->Id(); |
227 | 0 | if ((1) == (id)) { |
228 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
229 | 0 | } |
230 | 0 | } |
231 | 0 | WriteIPDLParam(aMsg, aActor, id); |
232 | 0 | } |
233 | | |
234 | | auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBRequestChild>::Read( |
235 | | const IPC::Message* aMsg, |
236 | | PickleIterator* aIter, |
237 | | mozilla::ipc::IProtocol* aActor, |
238 | | paramType* aVar) -> bool |
239 | 0 | { |
240 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PBackgroundIDBRequest", PBackgroundIDBRequestMsgStart); |
241 | 0 | if ((actor).isNothing()) { |
242 | 0 | return false; |
243 | 0 | } |
244 | 0 | |
245 | 0 | (*(aVar)) = static_cast<mozilla::dom::indexedDB::PBackgroundIDBRequestChild*>((actor).value()); |
246 | 0 | return true; |
247 | 0 | } |
248 | | |
249 | | } // namespace ipc |
250 | | } // namespace mozilla |