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