/work/obj-fuzz/ipc/ipdl/PVRParent.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/gfx/PVRParent.h" |
8 | | |
9 | | #include "mozilla/gfx/PVRGPUParent.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace gfx { |
16 | | |
17 | | |
18 | | auto PVRParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | auto PVRParent::ProcessingError( |
23 | | Result aCode, |
24 | | const char* aReason) -> void |
25 | 0 | { |
26 | 0 | } |
27 | | |
28 | | auto PVRParent::ShouldContinueFromReplyTimeout() -> bool |
29 | 0 | { |
30 | 0 | return true; |
31 | 0 | } |
32 | | |
33 | | auto PVRParent::EnteredCxxStack() -> void |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | auto PVRParent::ExitedCxxStack() -> void |
38 | 0 | { |
39 | 0 | } |
40 | | |
41 | | auto PVRParent::EnteredCall() -> void |
42 | 0 | { |
43 | 0 | } |
44 | | |
45 | | auto PVRParent::ExitedCall() -> void |
46 | 0 | { |
47 | 0 | } |
48 | | |
49 | | MOZ_IMPLICIT PVRParent::PVRParent() : |
50 | | mozilla::ipc::IToplevelProtocol("PVRParent", PVRMsgStart, mozilla::ipc::ParentSide), |
51 | | mLivenessState(mozilla::ipc::LivenessState::Start) |
52 | 0 | { |
53 | 0 | MOZ_COUNT_CTOR(PVRParent); |
54 | 0 | } |
55 | | |
56 | | PVRParent::~PVRParent() |
57 | 0 | { |
58 | 0 | MOZ_COUNT_DTOR(PVRParent); |
59 | 0 | } |
60 | | |
61 | | auto PVRParent::RemoveManagee( |
62 | | int32_t aProtocolId, |
63 | | IProtocol* aListener) -> void |
64 | 0 | { |
65 | 0 | FatalError("unreached"); |
66 | 0 | return; |
67 | 0 | } |
68 | | |
69 | | auto PVRParent::OnMessageReceived(const Message& msg__) -> PVRParent::Result |
70 | 0 | { |
71 | 0 | switch ((msg__).type()) { |
72 | 0 | case PVR::Msg_NewGPUVRManager__ID: |
73 | 0 | { |
74 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVRParent")) { |
75 | 0 | mozilla::ipc::LogMessageForProtocol("PVRParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
76 | 0 | } |
77 | 0 | AUTO_PROFILER_LABEL("PVR::Msg_NewGPUVRManager", OTHER); |
78 | 0 |
|
79 | 0 | PickleIterator iter__(msg__); |
80 | 0 | Endpoint<mozilla::gfx::PVRGPUParent> endpoint; |
81 | 0 |
|
82 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(endpoint)))))) { |
83 | 0 | FatalError("Error deserializing 'Endpoint<mozilla::gfx::PVRGPUParent>'"); |
84 | 0 | return MsgValueError; |
85 | 0 | } |
86 | 0 | // Sentinel = 'endpoint' |
87 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3610972515)))) { |
88 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'Endpoint<mozilla::gfx::PVRGPUParent>'"); |
89 | 0 | return MsgValueError; |
90 | 0 | } |
91 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
92 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
93 | 0 | FatalError("Transition error"); |
94 | 0 | return MsgValueError; |
95 | 0 | } |
96 | 0 | if ((!(RecvNewGPUVRManager(std::move(endpoint))))) { |
97 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
98 | 0 | // Error handled in mozilla::ipc::IPCResult |
99 | 0 | return MsgProcessingError; |
100 | 0 | } |
101 | 0 | |
102 | 0 | return MsgProcessed; |
103 | 0 | } |
104 | 0 | case PVR::Msg_Init__ID: |
105 | 0 | { |
106 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVRParent")) { |
107 | 0 | mozilla::ipc::LogMessageForProtocol("PVRParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
108 | 0 | } |
109 | 0 | AUTO_PROFILER_LABEL("PVR::Msg_Init", OTHER); |
110 | 0 |
|
111 | 0 | PickleIterator iter__(msg__); |
112 | 0 | nsTArray<GfxPrefSetting> prefs; |
113 | 0 | nsTArray<GfxVarUpdate> vars; |
114 | 0 | DevicePrefs devicePrefs; |
115 | 0 |
|
116 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(prefs)))))) { |
117 | 0 | FatalError("Error deserializing 'nsTArray'"); |
118 | 0 | return MsgValueError; |
119 | 0 | } |
120 | 0 | // Sentinel = 'prefs' |
121 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3194398011)))) { |
122 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
123 | 0 | return MsgValueError; |
124 | 0 | } |
125 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(vars)))))) { |
126 | 0 | FatalError("Error deserializing 'nsTArray'"); |
127 | 0 | return MsgValueError; |
128 | 0 | } |
129 | 0 | // Sentinel = 'vars' |
130 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2632090118)))) { |
131 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
132 | 0 | return MsgValueError; |
133 | 0 | } |
134 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(devicePrefs)))))) { |
135 | 0 | FatalError("Error deserializing 'DevicePrefs'"); |
136 | 0 | return MsgValueError; |
137 | 0 | } |
138 | 0 | // Sentinel = 'devicePrefs' |
139 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2200416183)))) { |
140 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'DevicePrefs'"); |
141 | 0 | return MsgValueError; |
142 | 0 | } |
143 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
144 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
145 | 0 | FatalError("Transition error"); |
146 | 0 | return MsgValueError; |
147 | 0 | } |
148 | 0 | if ((!(RecvInit(std::move(prefs), std::move(vars), devicePrefs)))) { |
149 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
150 | 0 | // Error handled in mozilla::ipc::IPCResult |
151 | 0 | return MsgProcessingError; |
152 | 0 | } |
153 | 0 | |
154 | 0 | return MsgProcessed; |
155 | 0 | } |
156 | 0 | case PVR::Msg_NotifyVsync__ID: |
157 | 0 | { |
158 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVRParent")) { |
159 | 0 | mozilla::ipc::LogMessageForProtocol("PVRParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
160 | 0 | } |
161 | 0 | AUTO_PROFILER_LABEL("PVR::Msg_NotifyVsync", OTHER); |
162 | 0 |
|
163 | 0 | PickleIterator iter__(msg__); |
164 | 0 | TimeStamp vsyncTimestamp; |
165 | 0 |
|
166 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(vsyncTimestamp)))))) { |
167 | 0 | FatalError("Error deserializing 'TimeStamp'"); |
168 | 0 | return MsgValueError; |
169 | 0 | } |
170 | 0 | // Sentinel = 'vsyncTimestamp' |
171 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2945375443)))) { |
172 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TimeStamp'"); |
173 | 0 | return MsgValueError; |
174 | 0 | } |
175 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
176 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
177 | 0 | FatalError("Transition error"); |
178 | 0 | return MsgValueError; |
179 | 0 | } |
180 | 0 | if ((!(RecvNotifyVsync(vsyncTimestamp)))) { |
181 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
182 | 0 | // Error handled in mozilla::ipc::IPCResult |
183 | 0 | return MsgProcessingError; |
184 | 0 | } |
185 | 0 | |
186 | 0 | return MsgProcessed; |
187 | 0 | } |
188 | 0 | case PVR::Msg_UpdatePref__ID: |
189 | 0 | { |
190 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVRParent")) { |
191 | 0 | mozilla::ipc::LogMessageForProtocol("PVRParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
192 | 0 | } |
193 | 0 | AUTO_PROFILER_LABEL("PVR::Msg_UpdatePref", OTHER); |
194 | 0 |
|
195 | 0 | PickleIterator iter__(msg__); |
196 | 0 | GfxPrefSetting pref; |
197 | 0 |
|
198 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(pref)))))) { |
199 | 0 | FatalError("Error deserializing 'GfxPrefSetting'"); |
200 | 0 | return MsgValueError; |
201 | 0 | } |
202 | 0 | // Sentinel = 'pref' |
203 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3089393963)))) { |
204 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'GfxPrefSetting'"); |
205 | 0 | return MsgValueError; |
206 | 0 | } |
207 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
208 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
209 | 0 | FatalError("Transition error"); |
210 | 0 | return MsgValueError; |
211 | 0 | } |
212 | 0 | if ((!(RecvUpdatePref(pref)))) { |
213 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
214 | 0 | // Error handled in mozilla::ipc::IPCResult |
215 | 0 | return MsgProcessingError; |
216 | 0 | } |
217 | 0 | |
218 | 0 | return MsgProcessed; |
219 | 0 | } |
220 | 0 | case PVR::Msg_UpdateVar__ID: |
221 | 0 | { |
222 | 0 | if (mozilla::ipc::LoggingEnabledFor("PVRParent")) { |
223 | 0 | mozilla::ipc::LogMessageForProtocol("PVRParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
224 | 0 | } |
225 | 0 | AUTO_PROFILER_LABEL("PVR::Msg_UpdateVar", OTHER); |
226 | 0 |
|
227 | 0 | PickleIterator iter__(msg__); |
228 | 0 | GfxVarUpdate var; |
229 | 0 |
|
230 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(var)))))) { |
231 | 0 | FatalError("Error deserializing 'GfxVarUpdate'"); |
232 | 0 | return MsgValueError; |
233 | 0 | } |
234 | 0 | // Sentinel = 'var' |
235 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2283110200)))) { |
236 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'GfxVarUpdate'"); |
237 | 0 | return MsgValueError; |
238 | 0 | } |
239 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
240 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
241 | 0 | FatalError("Transition error"); |
242 | 0 | return MsgValueError; |
243 | 0 | } |
244 | 0 | if ((!(RecvUpdateVar(var)))) { |
245 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
246 | 0 | // Error handled in mozilla::ipc::IPCResult |
247 | 0 | return MsgProcessingError; |
248 | 0 | } |
249 | 0 | |
250 | 0 | return MsgProcessed; |
251 | 0 | } |
252 | 0 | default: |
253 | 0 | { |
254 | 0 | return MsgNotKnown; |
255 | 0 | } |
256 | 0 | case SHMEM_CREATED_MESSAGE_TYPE: |
257 | 0 | { |
258 | 0 | FatalError("this protocol tree does not use shmem"); |
259 | 0 | return MsgNotKnown; |
260 | 0 | } |
261 | 0 | case SHMEM_DESTROYED_MESSAGE_TYPE: |
262 | 0 | { |
263 | 0 | FatalError("this protocol tree does not use shmem"); |
264 | 0 | return MsgNotKnown; |
265 | 0 | } |
266 | 0 | } |
267 | 0 | } |
268 | | |
269 | | auto PVRParent::OnMessageReceived( |
270 | | const Message& msg__, |
271 | | Message*& reply__) -> PVRParent::Result |
272 | 0 | { |
273 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
274 | 0 | return MsgNotKnown; |
275 | 0 | } |
276 | | |
277 | | auto PVRParent::OnCallReceived( |
278 | | const Message& msg__, |
279 | | Message*& reply__) -> PVRParent::Result |
280 | 0 | { |
281 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
282 | 0 | return MsgNotKnown; |
283 | 0 | } |
284 | | |
285 | | auto PVRParent::GetProtocolTypeId() -> int32_t |
286 | 0 | { |
287 | 0 | return PVRMsgStart; |
288 | 0 | } |
289 | | |
290 | | auto PVRParent::OnChannelClose() -> void |
291 | 0 | { |
292 | 0 | DestroySubtree(NormalShutdown); |
293 | 0 | DeallocSubtree(); |
294 | 0 | DeallocShmems(); |
295 | 0 | DeallocPVRParent(); |
296 | 0 | } |
297 | | |
298 | | auto PVRParent::OnChannelError() -> void |
299 | 0 | { |
300 | 0 | DestroySubtree(AbnormalShutdown); |
301 | 0 | DeallocSubtree(); |
302 | 0 | DeallocShmems(); |
303 | 0 | DeallocPVRParent(); |
304 | 0 | } |
305 | | |
306 | | auto PVRParent::DestroySubtree(ActorDestroyReason why) -> void |
307 | 0 | { |
308 | 0 | // Reject owning pending responses. |
309 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
310 | 0 |
|
311 | 0 | // Finally, destroy "us". |
312 | 0 | ActorDestroy(why); |
313 | 0 | } |
314 | | |
315 | | auto PVRParent::DeallocSubtree() -> void |
316 | 0 | { |
317 | 0 | } |
318 | | |
319 | | auto PVRParent::DeallocPVRParent() -> void |
320 | 0 | { |
321 | 0 | } |
322 | | |
323 | | |
324 | | |
325 | | } // namespace gfx |
326 | | } // namespace mozilla |
327 | | namespace mozilla { |
328 | | namespace ipc { |
329 | | auto IPDLParamTraits<mozilla::gfx::PVRParent>::Write( |
330 | | IPC::Message* aMsg, |
331 | | mozilla::ipc::IProtocol* aActor, |
332 | | const paramType& aVar) -> void |
333 | 0 | { |
334 | 0 | int32_t id; |
335 | 0 | if ((!(aVar))) { |
336 | 0 | id = 0; |
337 | 0 | } |
338 | 0 | else { |
339 | 0 | id = (aVar)->Id(); |
340 | 0 | if ((1) == (id)) { |
341 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
342 | 0 | } |
343 | 0 | } |
344 | 0 | WriteIPDLParam(aMsg, aActor, id); |
345 | 0 | } |
346 | | |
347 | | auto IPDLParamTraits<mozilla::gfx::PVRParent>::Read( |
348 | | const IPC::Message* aMsg, |
349 | | PickleIterator* aIter, |
350 | | mozilla::ipc::IProtocol* aActor, |
351 | | paramType* aVar) -> bool |
352 | 0 | { |
353 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PVR", PVRMsgStart); |
354 | 0 | if ((actor).isNothing()) { |
355 | 0 | return false; |
356 | 0 | } |
357 | 0 | |
358 | 0 | (*(aVar)) = static_cast<mozilla::gfx::PVRParent*>((actor).value()); |
359 | 0 | return true; |
360 | 0 | } |
361 | | |
362 | | } // namespace ipc |
363 | | } // namespace mozilla |