Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/PProcessHangMonitorChild.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 :
13 : #include "nsIFile.h"
14 : #include "GeckoProfiler.h"
15 :
16 : namespace mozilla {
17 :
18 :
19 0 : auto PProcessHangMonitorChild::ActorDestroy(ActorDestroyReason aWhy) -> void
20 : {
21 0 : }
22 :
23 0 : auto PProcessHangMonitorChild::ProcessingError(
24 : Result aCode,
25 : const char* aReason) -> void
26 : {
27 0 : }
28 :
29 0 : auto PProcessHangMonitorChild::ShouldContinueFromReplyTimeout() -> bool
30 : {
31 0 : return true;
32 : }
33 :
34 2 : auto PProcessHangMonitorChild::EnteredCxxStack() -> void
35 : {
36 2 : }
37 :
38 2 : auto PProcessHangMonitorChild::ExitedCxxStack() -> void
39 : {
40 2 : }
41 :
42 0 : auto PProcessHangMonitorChild::EnteredCall() -> void
43 : {
44 0 : }
45 :
46 0 : auto PProcessHangMonitorChild::ExitedCall() -> void
47 : {
48 0 : }
49 :
50 2 : MOZ_IMPLICIT PProcessHangMonitorChild::PProcessHangMonitorChild() :
51 : mozilla::ipc::IToplevelProtocol(PProcessHangMonitorMsgStart, mozilla::ipc::ChildSide),
52 : mChannel("PProcessHangMonitorChild", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
53 2 : mState(PProcessHangMonitor::__Start)
54 : {
55 2 : MOZ_COUNT_CTOR(PProcessHangMonitorChild);
56 2 : }
57 :
58 0 : PProcessHangMonitorChild::~PProcessHangMonitorChild()
59 : {
60 0 : MOZ_COUNT_DTOR(PProcessHangMonitorChild);
61 0 : }
62 :
63 0 : auto PProcessHangMonitorChild::SendHangEvidence(const HangData& data) -> bool
64 : {
65 0 : IPC::Message* msg__ = PProcessHangMonitor::Msg_HangEvidence(MSG_ROUTING_CONTROL);
66 :
67 0 : Write(data, msg__);
68 : // Sentinel = 'data'
69 0 : (msg__)->WriteSentinel(843352540);
70 :
71 :
72 :
73 :
74 0 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
75 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
76 : }
77 0 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_HangEvidence", OTHER);
78 0 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_HangEvidence__ID, (&(mState)));
79 :
80 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
81 0 : return sendok__;
82 : }
83 :
84 0 : auto PProcessHangMonitorChild::SendClearHang() -> bool
85 : {
86 0 : IPC::Message* msg__ = PProcessHangMonitor::Msg_ClearHang(MSG_ROUTING_CONTROL);
87 :
88 :
89 :
90 :
91 :
92 0 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
93 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
94 : }
95 0 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ClearHang", OTHER);
96 0 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_ClearHang__ID, (&(mState)));
97 :
98 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
99 0 : return sendok__;
100 : }
101 :
102 2 : auto PProcessHangMonitorChild::GetIPCChannel() -> MessageChannel*
103 : {
104 2 : return (&(mChannel));
105 : }
106 :
107 0 : auto PProcessHangMonitorChild::GetIPCChannel() const -> const MessageChannel*
108 : {
109 0 : return (&(mChannel));
110 : }
111 :
112 0 : auto PProcessHangMonitorChild::RemoveManagee(
113 : int32_t aProtocolId,
114 : ProtocolBase* aListener) -> void
115 : {
116 0 : FatalError("unreached");
117 0 : return;
118 : }
119 :
120 2 : auto PProcessHangMonitorChild::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorChild::Result
121 : {
122 2 : switch ((msg__).type()) {
123 : case PProcessHangMonitor::Msg_TerminateScript__ID:
124 : {
125 0 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
126 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
127 : }
128 0 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_TerminateScript", OTHER);
129 :
130 0 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_TerminateScript__ID, (&(mState)));
131 0 : if ((!(RecvTerminateScript()))) {
132 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
133 : // Error handled in mozilla::ipc::IPCResult
134 0 : return MsgProcessingError;
135 : }
136 :
137 0 : return MsgProcessed;
138 : }
139 : case PProcessHangMonitor::Msg_BeginStartingDebugger__ID:
140 : {
141 0 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
142 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
143 : }
144 0 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_BeginStartingDebugger", OTHER);
145 :
146 0 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_BeginStartingDebugger__ID, (&(mState)));
147 0 : if ((!(RecvBeginStartingDebugger()))) {
148 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
149 : // Error handled in mozilla::ipc::IPCResult
150 0 : return MsgProcessingError;
151 : }
152 :
153 0 : return MsgProcessed;
154 : }
155 : case PProcessHangMonitor::Msg_EndStartingDebugger__ID:
156 : {
157 0 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
158 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
159 : }
160 0 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_EndStartingDebugger", OTHER);
161 :
162 0 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_EndStartingDebugger__ID, (&(mState)));
163 0 : if ((!(RecvEndStartingDebugger()))) {
164 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
165 : // Error handled in mozilla::ipc::IPCResult
166 0 : return MsgProcessingError;
167 : }
168 :
169 0 : return MsgProcessed;
170 : }
171 : case PProcessHangMonitor::Msg_ForcePaint__ID:
172 : {
173 2 : if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorChild")) {
174 0 : mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
175 : }
176 4 : AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ForcePaint", OTHER);
177 :
178 2 : PickleIterator iter__(msg__);
179 2 : TabId tabId;
180 : uint64_t aLayerObserverEpoch;
181 :
182 2 : if ((!(Read((&(tabId)), (&(msg__)), (&(iter__)))))) {
183 0 : FatalError("Error deserializing 'TabId'");
184 0 : return MsgValueError;
185 : }
186 : // Sentinel = 'tabId'
187 2 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3419081923)))) {
188 0 : mozilla::ipc::SentinelReadError("Error deserializing 'TabId'");
189 0 : return MsgValueError;
190 : }
191 2 : if ((!(Read((&(aLayerObserverEpoch)), (&(msg__)), (&(iter__)))))) {
192 0 : FatalError("Error deserializing 'uint64_t'");
193 0 : return MsgValueError;
194 : }
195 : // Sentinel = 'aLayerObserverEpoch'
196 2 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3446156614)))) {
197 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
198 0 : return MsgValueError;
199 : }
200 2 : (msg__).EndRead(iter__, (msg__).type());
201 2 : PProcessHangMonitor::Transition(PProcessHangMonitor::Msg_ForcePaint__ID, (&(mState)));
202 2 : if ((!(RecvForcePaint(mozilla::Move(tabId), mozilla::Move(aLayerObserverEpoch))))) {
203 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
204 : // Error handled in mozilla::ipc::IPCResult
205 0 : return MsgProcessingError;
206 : }
207 :
208 2 : return MsgProcessed;
209 : }
210 : default:
211 : {
212 0 : return MsgNotKnown;
213 : }
214 : case SHMEM_CREATED_MESSAGE_TYPE:
215 : {
216 0 : FatalError("this protocol tree does not use shmem");
217 0 : return MsgNotKnown;
218 : }
219 : case SHMEM_DESTROYED_MESSAGE_TYPE:
220 : {
221 0 : FatalError("this protocol tree does not use shmem");
222 0 : return MsgNotKnown;
223 : }
224 : }
225 : }
226 :
227 0 : auto PProcessHangMonitorChild::OnMessageReceived(
228 : const Message& msg__,
229 : Message*& reply__) -> PProcessHangMonitorChild::Result
230 : {
231 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
232 : return MsgNotKnown;
233 : }
234 :
235 0 : auto PProcessHangMonitorChild::OnCallReceived(
236 : const Message& msg__,
237 : Message*& reply__) -> PProcessHangMonitorChild::Result
238 : {
239 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
240 : return MsgNotKnown;
241 : }
242 :
243 0 : auto PProcessHangMonitorChild::GetProtocolTypeId() -> int32_t
244 : {
245 0 : return PProcessHangMonitorMsgStart;
246 : }
247 :
248 0 : auto PProcessHangMonitorChild::OnChannelClose() -> void
249 : {
250 0 : DestroySubtree(NormalShutdown);
251 0 : DeallocSubtree();
252 0 : DeallocShmems();
253 0 : DeallocPProcessHangMonitorChild();
254 0 : }
255 :
256 0 : auto PProcessHangMonitorChild::OnChannelError() -> void
257 : {
258 0 : DestroySubtree(AbnormalShutdown);
259 0 : DeallocSubtree();
260 0 : DeallocShmems();
261 0 : DeallocPProcessHangMonitorChild();
262 0 : }
263 :
264 0 : auto PProcessHangMonitorChild::ProtocolName() const -> const char*
265 : {
266 0 : return "PProcessHangMonitorChild";
267 : }
268 :
269 0 : auto PProcessHangMonitorChild::DestroySubtree(ActorDestroyReason why) -> void
270 : {
271 : // Reject owning pending promises.
272 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
273 :
274 : // Finally, destroy "us".
275 0 : ActorDestroy(why);
276 0 : }
277 :
278 0 : auto PProcessHangMonitorChild::DeallocSubtree() -> void
279 : {
280 0 : }
281 :
282 0 : auto PProcessHangMonitorChild::DeallocPProcessHangMonitorChild() -> void
283 : {
284 0 : }
285 :
286 0 : auto PProcessHangMonitorChild::Write(
287 : const HangData& v__,
288 : Message* msg__) -> void
289 : {
290 : typedef HangData type__;
291 0 : Write(int((v__).type()), msg__);
292 : // Sentinel = 'HangData'
293 0 : (msg__)->WriteSentinel(424813128);
294 :
295 0 : switch ((v__).type()) {
296 : case type__::TSlowScriptData:
297 : {
298 0 : Write((v__).get_SlowScriptData(), msg__);
299 : // Sentinel = 'TSlowScriptData'
300 0 : (msg__)->WriteSentinel(2725568093);
301 0 : return;
302 : }
303 : case type__::TPluginHangData:
304 : {
305 0 : Write((v__).get_PluginHangData(), msg__);
306 : // Sentinel = 'TPluginHangData'
307 0 : (msg__)->WriteSentinel(2781280854);
308 0 : return;
309 : }
310 : default:
311 : {
312 0 : FatalError("unknown union type");
313 0 : return;
314 : }
315 : }
316 : }
317 :
318 0 : auto PProcessHangMonitorChild::Read(
319 : HangData* v__,
320 : const Message* msg__,
321 : PickleIterator* iter__) -> bool
322 : {
323 : typedef HangData type__;
324 : int type;
325 0 : if ((!(Read((&(type)), msg__, iter__)))) {
326 0 : mozilla::ipc::UnionTypeReadError("HangData");
327 0 : return false;
328 : }
329 : // Sentinel = 'HangData'
330 0 : if ((!((msg__)->ReadSentinel(iter__, 424813128)))) {
331 0 : mozilla::ipc::SentinelReadError("HangData");
332 0 : return false;
333 : }
334 :
335 0 : switch (type) {
336 : case type__::TSlowScriptData:
337 : {
338 0 : SlowScriptData tmp = SlowScriptData();
339 0 : (*(v__)) = tmp;
340 0 : if ((!(Read((&((v__)->get_SlowScriptData())), msg__, iter__)))) {
341 0 : FatalError("Error deserializing Union type");
342 0 : return false;
343 : }
344 : // Sentinel = 'TSlowScriptData'
345 0 : if ((!((msg__)->ReadSentinel(iter__, 2725568093)))) {
346 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
347 0 : return false;
348 : }
349 0 : return true;
350 : }
351 : case type__::TPluginHangData:
352 : {
353 0 : PluginHangData tmp = PluginHangData();
354 0 : (*(v__)) = tmp;
355 0 : if ((!(Read((&((v__)->get_PluginHangData())), msg__, iter__)))) {
356 0 : FatalError("Error deserializing Union type");
357 0 : return false;
358 : }
359 : // Sentinel = 'TPluginHangData'
360 0 : if ((!((msg__)->ReadSentinel(iter__, 2781280854)))) {
361 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
362 0 : return false;
363 : }
364 0 : return true;
365 : }
366 : default:
367 : {
368 0 : FatalError("unknown union type");
369 0 : return false;
370 : }
371 : }
372 : }
373 :
374 0 : auto PProcessHangMonitorChild::Write(
375 : const PluginHangData& v__,
376 : Message* msg__) -> void
377 : {
378 0 : Write((v__).pluginId(), msg__);
379 : // Sentinel = 'pluginId'
380 0 : (msg__)->WriteSentinel(1563488274);
381 0 : Write((v__).contentProcessId(), msg__);
382 : // Sentinel = 'contentProcessId'
383 0 : (msg__)->WriteSentinel(3482197741);
384 0 : }
385 :
386 0 : auto PProcessHangMonitorChild::Read(
387 : PluginHangData* v__,
388 : const Message* msg__,
389 : PickleIterator* iter__) -> bool
390 : {
391 0 : if ((!(Read((&((v__)->pluginId())), msg__, iter__)))) {
392 0 : FatalError("Error deserializing 'pluginId' (uint32_t) member of 'PluginHangData'");
393 0 : return false;
394 : }
395 : // Sentinel = 'pluginId'
396 0 : if ((!((msg__)->ReadSentinel(iter__, 1563488274)))) {
397 0 : mozilla::ipc::SentinelReadError("Error deserializing 'pluginId' (uint32_t) member of 'PluginHangData'");
398 0 : return false;
399 : }
400 0 : if ((!(Read((&((v__)->contentProcessId())), msg__, iter__)))) {
401 0 : FatalError("Error deserializing 'contentProcessId' (ProcessId) member of 'PluginHangData'");
402 0 : return false;
403 : }
404 : // Sentinel = 'contentProcessId'
405 0 : if ((!((msg__)->ReadSentinel(iter__, 3482197741)))) {
406 0 : mozilla::ipc::SentinelReadError("Error deserializing 'contentProcessId' (ProcessId) member of 'PluginHangData'");
407 0 : return false;
408 : }
409 0 : return true;
410 : }
411 :
412 0 : auto PProcessHangMonitorChild::Write(
413 : const SlowScriptData& v__,
414 : Message* msg__) -> void
415 : {
416 0 : Write((v__).tabId(), msg__);
417 : // Sentinel = 'tabId'
418 0 : (msg__)->WriteSentinel(3419081923);
419 0 : Write((v__).filename(), msg__);
420 : // Sentinel = 'filename'
421 0 : (msg__)->WriteSentinel(1198638255);
422 0 : }
423 :
424 0 : auto PProcessHangMonitorChild::Read(
425 : SlowScriptData* v__,
426 : const Message* msg__,
427 : PickleIterator* iter__) -> bool
428 : {
429 0 : if ((!(Read((&((v__)->tabId())), msg__, iter__)))) {
430 0 : FatalError("Error deserializing 'tabId' (TabId) member of 'SlowScriptData'");
431 0 : return false;
432 : }
433 : // Sentinel = 'tabId'
434 0 : if ((!((msg__)->ReadSentinel(iter__, 3419081923)))) {
435 0 : mozilla::ipc::SentinelReadError("Error deserializing 'tabId' (TabId) member of 'SlowScriptData'");
436 0 : return false;
437 : }
438 0 : if ((!(Read((&((v__)->filename())), msg__, iter__)))) {
439 0 : FatalError("Error deserializing 'filename' (nsCString) member of 'SlowScriptData'");
440 0 : return false;
441 : }
442 : // Sentinel = 'filename'
443 0 : if ((!((msg__)->ReadSentinel(iter__, 1198638255)))) {
444 0 : mozilla::ipc::SentinelReadError("Error deserializing 'filename' (nsCString) member of 'SlowScriptData'");
445 0 : return false;
446 : }
447 0 : return true;
448 : }
449 :
450 :
451 :
452 : } // namespace mozilla
|