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