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