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