/work/obj-fuzz/ipc/ipdl/PBrowserStreamChild.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/plugins/PBrowserStreamChild.h" |
8 | | |
9 | | #include "mozilla/plugins/PPluginInstanceChild.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace plugins { |
16 | | |
17 | | |
18 | | auto PBrowserStreamChild::Recv__delete__() -> mozilla::ipc::IPCResult |
19 | 0 | { |
20 | 0 | return IPC_OK(); |
21 | 0 | } |
22 | | |
23 | | auto PBrowserStreamChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | MOZ_IMPLICIT PBrowserStreamChild::PBrowserStreamChild() : |
28 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
29 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
30 | 0 | { |
31 | 0 | MOZ_COUNT_CTOR(PBrowserStreamChild); |
32 | 0 | } |
33 | | |
34 | | PBrowserStreamChild::~PBrowserStreamChild() |
35 | 0 | { |
36 | 0 | MOZ_COUNT_DTOR(PBrowserStreamChild); |
37 | 0 | } |
38 | | |
39 | | auto PBrowserStreamChild::Manager() const -> PPluginInstanceChild* |
40 | 0 | { |
41 | 0 | return static_cast<PPluginInstanceChild*>(IProtocol::Manager()); |
42 | 0 | } |
43 | | |
44 | | auto PBrowserStreamChild::SendStreamDestroyed() -> bool |
45 | 0 | { |
46 | 0 | IPC::Message* msg__ = PBrowserStream::Msg_StreamDestroyed(Id()); |
47 | 0 |
|
48 | 0 |
|
49 | 0 |
|
50 | 0 |
|
51 | 0 |
|
52 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBrowserStreamChild")) { |
53 | 0 | mozilla::ipc::LogMessageForProtocol("PBrowserStreamChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
54 | 0 | } |
55 | 0 | AUTO_PROFILER_LABEL("PBrowserStream::Msg_StreamDestroyed", 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 PBrowserStreamChild::RemoveManagee( |
65 | | int32_t aProtocolId, |
66 | | IProtocol* aListener) -> void |
67 | 0 | { |
68 | 0 | FatalError("unreached"); |
69 | 0 | return; |
70 | 0 | } |
71 | | |
72 | | auto PBrowserStreamChild::OnMessageReceived(const Message& msg__) -> PBrowserStreamChild::Result |
73 | 0 | { |
74 | 0 | switch ((msg__).type()) { |
75 | 0 | case PBrowserStream::Msg_Write__ID: |
76 | 0 | { |
77 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBrowserStreamChild")) { |
78 | 0 | mozilla::ipc::LogMessageForProtocol("PBrowserStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
79 | 0 | } |
80 | 0 | AUTO_PROFILER_LABEL("PBrowserStream::Msg_Write", OTHER); |
81 | 0 |
|
82 | 0 | PickleIterator iter__(msg__); |
83 | 0 | int32_t offset; |
84 | 0 | uint32_t newlength; |
85 | 0 | Buffer data; |
86 | 0 |
|
87 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(offset)))))) { |
88 | 0 | FatalError("Error deserializing 'int32_t'"); |
89 | 0 | return MsgValueError; |
90 | 0 | } |
91 | 0 | // Sentinel = 'offset' |
92 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1369947863)))) { |
93 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'"); |
94 | 0 | return MsgValueError; |
95 | 0 | } |
96 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(newlength)))))) { |
97 | 0 | FatalError("Error deserializing 'uint32_t'"); |
98 | 0 | return MsgValueError; |
99 | 0 | } |
100 | 0 | // Sentinel = 'newlength' |
101 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 923227399)))) { |
102 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
103 | 0 | return MsgValueError; |
104 | 0 | } |
105 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) { |
106 | 0 | FatalError("Error deserializing 'Buffer'"); |
107 | 0 | return MsgValueError; |
108 | 0 | } |
109 | 0 | // Sentinel = 'data' |
110 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) { |
111 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'Buffer'"); |
112 | 0 | return MsgValueError; |
113 | 0 | } |
114 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
115 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
116 | 0 | FatalError("Transition error"); |
117 | 0 | return MsgValueError; |
118 | 0 | } |
119 | 0 | if ((!(RecvWrite(offset, newlength, data)))) { |
120 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
121 | 0 | // Error handled in mozilla::ipc::IPCResult |
122 | 0 | return MsgProcessingError; |
123 | 0 | } |
124 | 0 | |
125 | 0 | return MsgProcessed; |
126 | 0 | } |
127 | 0 | case PBrowserStream::Msg_NPP_DestroyStream__ID: |
128 | 0 | { |
129 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBrowserStreamChild")) { |
130 | 0 | mozilla::ipc::LogMessageForProtocol("PBrowserStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
131 | 0 | } |
132 | 0 | AUTO_PROFILER_LABEL("PBrowserStream::Msg_NPP_DestroyStream", OTHER); |
133 | 0 |
|
134 | 0 | PickleIterator iter__(msg__); |
135 | 0 | NPReason reason; |
136 | 0 |
|
137 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(reason)))))) { |
138 | 0 | FatalError("Error deserializing 'NPReason'"); |
139 | 0 | return MsgValueError; |
140 | 0 | } |
141 | 0 | // Sentinel = 'reason' |
142 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4151390930)))) { |
143 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'NPReason'"); |
144 | 0 | return MsgValueError; |
145 | 0 | } |
146 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
147 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
148 | 0 | FatalError("Transition error"); |
149 | 0 | return MsgValueError; |
150 | 0 | } |
151 | 0 | if ((!(RecvNPP_DestroyStream(reason)))) { |
152 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
153 | 0 | // Error handled in mozilla::ipc::IPCResult |
154 | 0 | return MsgProcessingError; |
155 | 0 | } |
156 | 0 | |
157 | 0 | return MsgProcessed; |
158 | 0 | } |
159 | 0 | case PBrowserStream::Msg___delete____ID: |
160 | 0 | { |
161 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBrowserStreamChild")) { |
162 | 0 | mozilla::ipc::LogMessageForProtocol("PBrowserStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
163 | 0 | } |
164 | 0 | AUTO_PROFILER_LABEL("PBrowserStream::Msg___delete__", OTHER); |
165 | 0 |
|
166 | 0 | PickleIterator iter__(msg__); |
167 | 0 | PBrowserStreamChild* actor; |
168 | 0 |
|
169 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
170 | 0 | FatalError("Error deserializing 'PBrowserStreamChild'"); |
171 | 0 | return MsgValueError; |
172 | 0 | } |
173 | 0 | if ((!((*((&(actor))))))) { |
174 | 0 | FatalError("Error deserializing 'PBrowserStreamChild'"); |
175 | 0 | return MsgValueError; |
176 | 0 | } |
177 | 0 | // Sentinel = 'actor' |
178 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
179 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBrowserStreamChild'"); |
180 | 0 | return MsgValueError; |
181 | 0 | } |
182 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
183 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
184 | 0 | FatalError("Transition error"); |
185 | 0 | return MsgValueError; |
186 | 0 | } |
187 | 0 | if ((!(Recv__delete__()))) { |
188 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
189 | 0 | // Error handled in mozilla::ipc::IPCResult |
190 | 0 | return MsgProcessingError; |
191 | 0 | } |
192 | 0 | |
193 | 0 | |
194 | 0 | IProtocol* mgr = (actor)->Manager(); |
195 | 0 | (actor)->DestroySubtree(Deletion); |
196 | 0 | (actor)->DeallocSubtree(); |
197 | 0 | (mgr)->RemoveManagee(PBrowserStreamMsgStart, actor); |
198 | 0 |
|
199 | 0 | return MsgProcessed; |
200 | 0 | } |
201 | 0 | default: |
202 | 0 | { |
203 | 0 | return MsgNotKnown; |
204 | 0 | } |
205 | 0 | } |
206 | 0 | } |
207 | | |
208 | | auto PBrowserStreamChild::OnMessageReceived( |
209 | | const Message& msg__, |
210 | | Message*& reply__) -> PBrowserStreamChild::Result |
211 | 0 | { |
212 | 0 | return MsgNotKnown; |
213 | 0 | } |
214 | | |
215 | | auto PBrowserStreamChild::OnCallReceived( |
216 | | const Message& msg__, |
217 | | Message*& reply__) -> PBrowserStreamChild::Result |
218 | 0 | { |
219 | 0 | return MsgNotKnown; |
220 | 0 | } |
221 | | |
222 | | auto PBrowserStreamChild::GetProtocolTypeId() -> int32_t |
223 | 0 | { |
224 | 0 | return PBrowserStreamMsgStart; |
225 | 0 | } |
226 | | |
227 | | auto PBrowserStreamChild::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 PBrowserStreamChild::DeallocSubtree() -> void |
240 | 0 | { |
241 | 0 | } |
242 | | |
243 | | |
244 | | |
245 | | } // namespace plugins |
246 | | } // namespace mozilla |
247 | | namespace mozilla { |
248 | | namespace ipc { |
249 | | auto IPDLParamTraits<mozilla::plugins::PBrowserStreamChild>::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::plugins::PBrowserStreamChild>::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, "PBrowserStream", PBrowserStreamMsgStart); |
274 | 0 | if ((actor).isNothing()) { |
275 | 0 | return false; |
276 | 0 | } |
277 | 0 | |
278 | 0 | (*(aVar)) = static_cast<mozilla::plugins::PBrowserStreamChild*>((actor).value()); |
279 | 0 | return true; |
280 | 0 | } |
281 | | |
282 | | } // namespace ipc |
283 | | } // namespace mozilla |