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