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