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