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