Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPTimerParent.h"
8 :
9 : #include "mozilla/gmp/PGMPParent.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace gmp {
16 :
17 :
18 0 : auto PGMPTimerParent::Recv__delete__() -> mozilla::ipc::IPCResult
19 : {
20 0 : return IPC_OK();
21 : }
22 :
23 :
24 0 : MOZ_IMPLICIT PGMPTimerParent::PGMPTimerParent() :
25 : mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
26 0 : mState(PGMPTimer::__Dead)
27 : {
28 0 : MOZ_COUNT_CTOR(PGMPTimerParent);
29 0 : }
30 :
31 0 : PGMPTimerParent::~PGMPTimerParent()
32 : {
33 0 : MOZ_COUNT_DTOR(PGMPTimerParent);
34 0 : }
35 :
36 0 : auto PGMPTimerParent::Manager() const -> PGMPParent*
37 : {
38 0 : return static_cast<PGMPParent*>(IProtocol::Manager());
39 : }
40 :
41 0 : auto PGMPTimerParent::SendTimerExpired(const uint32_t& aTimerId) -> bool
42 : {
43 0 : IPC::Message* msg__ = PGMPTimer::Msg_TimerExpired(Id());
44 :
45 0 : Write(aTimerId, msg__);
46 : // Sentinel = 'aTimerId'
47 0 : (msg__)->WriteSentinel(3522148191);
48 :
49 :
50 :
51 :
52 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPTimerParent")) {
53 0 : mozilla::ipc::LogMessageForProtocol("PGMPTimerParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54 : }
55 0 : AUTO_PROFILER_LABEL("PGMPTimer::Msg_TimerExpired", OTHER);
56 0 : PGMPTimer::Transition(PGMPTimer::Msg_TimerExpired__ID, (&(mState)));
57 :
58 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
59 0 : return sendok__;
60 : }
61 :
62 0 : auto PGMPTimerParent::RemoveManagee(
63 : int32_t aProtocolId,
64 : ProtocolBase* aListener) -> void
65 : {
66 0 : FatalError("unreached");
67 0 : return;
68 : }
69 :
70 0 : auto PGMPTimerParent::OnMessageReceived(const Message& msg__) -> PGMPTimerParent::Result
71 : {
72 0 : switch ((msg__).type()) {
73 : case PGMPTimer::Msg_SetTimer__ID:
74 : {
75 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPTimerParent")) {
76 0 : mozilla::ipc::LogMessageForProtocol("PGMPTimerParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
77 : }
78 0 : AUTO_PROFILER_LABEL("PGMPTimer::Msg_SetTimer", OTHER);
79 :
80 0 : PickleIterator iter__(msg__);
81 : uint32_t aTimerId;
82 : uint32_t aTimeoutMs;
83 :
84 0 : if ((!(Read((&(aTimerId)), (&(msg__)), (&(iter__)))))) {
85 0 : FatalError("Error deserializing 'uint32_t'");
86 0 : return MsgValueError;
87 : }
88 : // Sentinel = 'aTimerId'
89 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3522148191)))) {
90 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
91 0 : return MsgValueError;
92 : }
93 0 : if ((!(Read((&(aTimeoutMs)), (&(msg__)), (&(iter__)))))) {
94 0 : FatalError("Error deserializing 'uint32_t'");
95 0 : return MsgValueError;
96 : }
97 : // Sentinel = 'aTimeoutMs'
98 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 25578592)))) {
99 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
100 0 : return MsgValueError;
101 : }
102 0 : (msg__).EndRead(iter__, (msg__).type());
103 0 : PGMPTimer::Transition(PGMPTimer::Msg_SetTimer__ID, (&(mState)));
104 0 : if ((!(RecvSetTimer(mozilla::Move(aTimerId), mozilla::Move(aTimeoutMs))))) {
105 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
106 : // Error handled in mozilla::ipc::IPCResult
107 0 : return MsgProcessingError;
108 : }
109 :
110 0 : return MsgProcessed;
111 : }
112 : case PGMPTimer::Msg___delete____ID:
113 : {
114 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPTimerParent")) {
115 0 : mozilla::ipc::LogMessageForProtocol("PGMPTimerParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
116 : }
117 0 : AUTO_PROFILER_LABEL("PGMPTimer::Msg___delete__", OTHER);
118 :
119 0 : PickleIterator iter__(msg__);
120 : PGMPTimerParent* actor;
121 :
122 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
123 0 : FatalError("Error deserializing 'PGMPTimerParent'");
124 0 : return MsgValueError;
125 : }
126 : // Sentinel = 'actor'
127 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
128 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PGMPTimerParent'");
129 0 : return MsgValueError;
130 : }
131 0 : (msg__).EndRead(iter__, (msg__).type());
132 0 : PGMPTimer::Transition(PGMPTimer::Msg___delete____ID, (&(mState)));
133 0 : if ((!(Recv__delete__()))) {
134 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
135 : // Error handled in mozilla::ipc::IPCResult
136 0 : return MsgProcessingError;
137 : }
138 :
139 :
140 0 : IProtocol* mgr = (actor)->Manager();
141 0 : (actor)->DestroySubtree(Deletion);
142 0 : (actor)->DeallocSubtree();
143 0 : (mgr)->RemoveManagee(PGMPTimerMsgStart, actor);
144 :
145 0 : return MsgProcessed;
146 : }
147 : default:
148 : {
149 0 : return MsgNotKnown;
150 : }
151 : }
152 : }
153 :
154 0 : auto PGMPTimerParent::OnMessageReceived(
155 : const Message& msg__,
156 : Message*& reply__) -> PGMPTimerParent::Result
157 : {
158 0 : return MsgNotKnown;
159 : }
160 :
161 0 : auto PGMPTimerParent::OnCallReceived(
162 : const Message& msg__,
163 : Message*& reply__) -> PGMPTimerParent::Result
164 : {
165 0 : return MsgNotKnown;
166 : }
167 :
168 0 : auto PGMPTimerParent::GetProtocolTypeId() -> int32_t
169 : {
170 0 : return PGMPTimerMsgStart;
171 : }
172 :
173 0 : auto PGMPTimerParent::ProtocolName() const -> const char*
174 : {
175 0 : return "PGMPTimerParent";
176 : }
177 :
178 0 : auto PGMPTimerParent::DestroySubtree(ActorDestroyReason why) -> void
179 : {
180 : // Unregister from our manager.
181 0 : Unregister(Id());
182 :
183 : // Reject owning pending promises.
184 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
185 :
186 : // Finally, destroy "us".
187 0 : ActorDestroy(why);
188 0 : }
189 :
190 0 : auto PGMPTimerParent::DeallocSubtree() -> void
191 : {
192 0 : }
193 :
194 0 : auto PGMPTimerParent::Write(
195 : const PGMPTimerParent* v__,
196 : Message* msg__,
197 : bool nullable__) -> void
198 : {
199 : int32_t id;
200 0 : if ((!(v__))) {
201 0 : if ((!(nullable__))) {
202 0 : FatalError("NULL actor value passed to non-nullable param");
203 : }
204 0 : id = 0;
205 : }
206 : else {
207 0 : id = (v__)->Id();
208 0 : if ((1) == (id)) {
209 0 : FatalError("actor has been |delete|d");
210 : }
211 : }
212 :
213 0 : Write(id, msg__);
214 0 : }
215 :
216 0 : auto PGMPTimerParent::Read(
217 : PGMPTimerParent** v__,
218 : const Message* msg__,
219 : PickleIterator* iter__,
220 : bool nullable__) -> bool
221 : {
222 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPTimer", PGMPTimerMsgStart);
223 0 : if ((actor).isNothing()) {
224 0 : return false;
225 : }
226 :
227 0 : (*(v__)) = static_cast<PGMPTimerParent*>((actor).value());
228 0 : return true;
229 : }
230 :
231 :
232 :
233 : } // namespace gmp
234 : } // namespace mozilla
|