/work/obj-fuzz/ipc/ipdl/PProcessHangMonitorParent.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/PProcessHangMonitorParent.h" |
8 | | |
9 | | |
10 | | #include "nsIFile.h" |
11 | | #include "GeckoProfiler.h" |
12 | | |
13 | | namespace mozilla { |
14 | | |
15 | | |
16 | | auto PProcessHangMonitorParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
17 | 0 | { |
18 | 0 | } |
19 | | |
20 | | auto PProcessHangMonitorParent::ProcessingError( |
21 | | Result aCode, |
22 | | const char* aReason) -> void |
23 | 0 | { |
24 | 0 | } |
25 | | |
26 | | auto PProcessHangMonitorParent::ShouldContinueFromReplyTimeout() -> bool |
27 | 0 | { |
28 | 0 | return true; |
29 | 0 | } |
30 | | |
31 | | auto PProcessHangMonitorParent::EnteredCxxStack() -> void |
32 | 0 | { |
33 | 0 | } |
34 | | |
35 | | auto PProcessHangMonitorParent::ExitedCxxStack() -> void |
36 | 0 | { |
37 | 0 | } |
38 | | |
39 | | auto PProcessHangMonitorParent::EnteredCall() -> void |
40 | 0 | { |
41 | 0 | } |
42 | | |
43 | | auto PProcessHangMonitorParent::ExitedCall() -> void |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | MOZ_IMPLICIT PProcessHangMonitorParent::PProcessHangMonitorParent() : |
48 | | mozilla::ipc::IToplevelProtocol("PProcessHangMonitorParent", PProcessHangMonitorMsgStart, mozilla::ipc::ParentSide), |
49 | | mLivenessState(mozilla::ipc::LivenessState::Start) |
50 | 0 | { |
51 | 0 | MOZ_COUNT_CTOR(PProcessHangMonitorParent); |
52 | 0 | } |
53 | | |
54 | | PProcessHangMonitorParent::~PProcessHangMonitorParent() |
55 | 0 | { |
56 | 0 | MOZ_COUNT_DTOR(PProcessHangMonitorParent); |
57 | 0 | } |
58 | | |
59 | | auto PProcessHangMonitorParent::SendTerminateScript(const bool& aTerminateGlobal) -> bool |
60 | 0 | { |
61 | 0 | IPC::Message* msg__ = PProcessHangMonitor::Msg_TerminateScript(MSG_ROUTING_CONTROL); |
62 | 0 |
|
63 | 0 | WriteIPDLParam(msg__, this, aTerminateGlobal); |
64 | 0 | // Sentinel = 'aTerminateGlobal' |
65 | 0 | (msg__)->WriteSentinel(1388894779); |
66 | 0 |
|
67 | 0 |
|
68 | 0 |
|
69 | 0 |
|
70 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
71 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
72 | 0 | } |
73 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_TerminateScript", OTHER); |
74 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
75 | 0 | mozilla::ipc::LogicError("Transition error"); |
76 | 0 | } |
77 | 0 |
|
78 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
79 | 0 | return sendok__; |
80 | 0 | } |
81 | | |
82 | | auto PProcessHangMonitorParent::SendBeginStartingDebugger() -> bool |
83 | 0 | { |
84 | 0 | IPC::Message* msg__ = PProcessHangMonitor::Msg_BeginStartingDebugger(MSG_ROUTING_CONTROL); |
85 | 0 |
|
86 | 0 |
|
87 | 0 |
|
88 | 0 |
|
89 | 0 |
|
90 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
91 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
92 | 0 | } |
93 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_BeginStartingDebugger", OTHER); |
94 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
95 | 0 | mozilla::ipc::LogicError("Transition error"); |
96 | 0 | } |
97 | 0 |
|
98 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
99 | 0 | return sendok__; |
100 | 0 | } |
101 | | |
102 | | auto PProcessHangMonitorParent::SendEndStartingDebugger() -> bool |
103 | 0 | { |
104 | 0 | IPC::Message* msg__ = PProcessHangMonitor::Msg_EndStartingDebugger(MSG_ROUTING_CONTROL); |
105 | 0 |
|
106 | 0 |
|
107 | 0 |
|
108 | 0 |
|
109 | 0 |
|
110 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
111 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
112 | 0 | } |
113 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_EndStartingDebugger", OTHER); |
114 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
115 | 0 | mozilla::ipc::LogicError("Transition error"); |
116 | 0 | } |
117 | 0 |
|
118 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
119 | 0 | return sendok__; |
120 | 0 | } |
121 | | |
122 | | auto PProcessHangMonitorParent::SendPaintWhileInterruptingJS( |
123 | | const TabId& tabId, |
124 | | const bool& forceRepaint, |
125 | | const LayersObserverEpoch& aEpoch) -> bool |
126 | 0 | { |
127 | 0 | IPC::Message* msg__ = PProcessHangMonitor::Msg_PaintWhileInterruptingJS(MSG_ROUTING_CONTROL); |
128 | 0 |
|
129 | 0 | WriteIPDLParam(msg__, this, tabId); |
130 | 0 | // Sentinel = 'tabId' |
131 | 0 | (msg__)->WriteSentinel(3419081923); |
132 | 0 | WriteIPDLParam(msg__, this, forceRepaint); |
133 | 0 | // Sentinel = 'forceRepaint' |
134 | 0 | (msg__)->WriteSentinel(1474735206); |
135 | 0 | WriteIPDLParam(msg__, this, aEpoch); |
136 | 0 | // Sentinel = 'aEpoch' |
137 | 0 | (msg__)->WriteSentinel(2333012390); |
138 | 0 |
|
139 | 0 |
|
140 | 0 |
|
141 | 0 |
|
142 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
143 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
144 | 0 | } |
145 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_PaintWhileInterruptingJS", OTHER); |
146 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
147 | 0 | mozilla::ipc::LogicError("Transition error"); |
148 | 0 | } |
149 | 0 |
|
150 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
151 | 0 | return sendok__; |
152 | 0 | } |
153 | | |
154 | | auto PProcessHangMonitorParent::RemoveManagee( |
155 | | int32_t aProtocolId, |
156 | | IProtocol* aListener) -> void |
157 | 0 | { |
158 | 0 | FatalError("unreached"); |
159 | 0 | return; |
160 | 0 | } |
161 | | |
162 | | auto PProcessHangMonitorParent::OnMessageReceived(const Message& msg__) -> PProcessHangMonitorParent::Result |
163 | 0 | { |
164 | 0 | switch ((msg__).type()) { |
165 | 0 | case PProcessHangMonitor::Msg_HangEvidence__ID: |
166 | 0 | { |
167 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
168 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
169 | 0 | } |
170 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_HangEvidence", OTHER); |
171 | 0 |
|
172 | 0 | PickleIterator iter__(msg__); |
173 | 0 | HangData data; |
174 | 0 |
|
175 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) { |
176 | 0 | FatalError("Error deserializing 'HangData'"); |
177 | 0 | return MsgValueError; |
178 | 0 | } |
179 | 0 | // Sentinel = 'data' |
180 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) { |
181 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'HangData'"); |
182 | 0 | return MsgValueError; |
183 | 0 | } |
184 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
185 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
186 | 0 | FatalError("Transition error"); |
187 | 0 | return MsgValueError; |
188 | 0 | } |
189 | 0 | if ((!(RecvHangEvidence(data)))) { |
190 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
191 | 0 | // Error handled in mozilla::ipc::IPCResult |
192 | 0 | return MsgProcessingError; |
193 | 0 | } |
194 | 0 | |
195 | 0 | return MsgProcessed; |
196 | 0 | } |
197 | 0 | case PProcessHangMonitor::Msg_ClearHang__ID: |
198 | 0 | { |
199 | 0 | if (mozilla::ipc::LoggingEnabledFor("PProcessHangMonitorParent")) { |
200 | 0 | mozilla::ipc::LogMessageForProtocol("PProcessHangMonitorParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
201 | 0 | } |
202 | 0 | AUTO_PROFILER_LABEL("PProcessHangMonitor::Msg_ClearHang", OTHER); |
203 | 0 |
|
204 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
205 | 0 | FatalError("Transition error"); |
206 | 0 | return MsgValueError; |
207 | 0 | } |
208 | 0 | if ((!(RecvClearHang()))) { |
209 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
210 | 0 | // Error handled in mozilla::ipc::IPCResult |
211 | 0 | return MsgProcessingError; |
212 | 0 | } |
213 | 0 | |
214 | 0 | return MsgProcessed; |
215 | 0 | } |
216 | 0 | default: |
217 | 0 | { |
218 | 0 | return MsgNotKnown; |
219 | 0 | } |
220 | 0 | case SHMEM_CREATED_MESSAGE_TYPE: |
221 | 0 | { |
222 | 0 | FatalError("this protocol tree does not use shmem"); |
223 | 0 | return MsgNotKnown; |
224 | 0 | } |
225 | 0 | case SHMEM_DESTROYED_MESSAGE_TYPE: |
226 | 0 | { |
227 | 0 | FatalError("this protocol tree does not use shmem"); |
228 | 0 | return MsgNotKnown; |
229 | 0 | } |
230 | 0 | } |
231 | 0 | } |
232 | | |
233 | | auto PProcessHangMonitorParent::OnMessageReceived( |
234 | | const Message& msg__, |
235 | | Message*& reply__) -> PProcessHangMonitorParent::Result |
236 | 0 | { |
237 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
238 | 0 | return MsgNotKnown; |
239 | 0 | } |
240 | | |
241 | | auto PProcessHangMonitorParent::OnCallReceived( |
242 | | const Message& msg__, |
243 | | Message*& reply__) -> PProcessHangMonitorParent::Result |
244 | 0 | { |
245 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
246 | 0 | return MsgNotKnown; |
247 | 0 | } |
248 | | |
249 | | auto PProcessHangMonitorParent::GetProtocolTypeId() -> int32_t |
250 | 0 | { |
251 | 0 | return PProcessHangMonitorMsgStart; |
252 | 0 | } |
253 | | |
254 | | auto PProcessHangMonitorParent::OnChannelClose() -> void |
255 | 0 | { |
256 | 0 | DestroySubtree(NormalShutdown); |
257 | 0 | DeallocSubtree(); |
258 | 0 | DeallocShmems(); |
259 | 0 | DeallocPProcessHangMonitorParent(); |
260 | 0 | } |
261 | | |
262 | | auto PProcessHangMonitorParent::OnChannelError() -> void |
263 | 0 | { |
264 | 0 | DestroySubtree(AbnormalShutdown); |
265 | 0 | DeallocSubtree(); |
266 | 0 | DeallocShmems(); |
267 | 0 | DeallocPProcessHangMonitorParent(); |
268 | 0 | } |
269 | | |
270 | | auto PProcessHangMonitorParent::DestroySubtree(ActorDestroyReason why) -> void |
271 | 0 | { |
272 | 0 | // Reject owning pending responses. |
273 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
274 | 0 |
|
275 | 0 | // Finally, destroy "us". |
276 | 0 | ActorDestroy(why); |
277 | 0 | } |
278 | | |
279 | | auto PProcessHangMonitorParent::DeallocSubtree() -> void |
280 | 0 | { |
281 | 0 | } |
282 | | |
283 | | auto PProcessHangMonitorParent::DeallocPProcessHangMonitorParent() -> void |
284 | 0 | { |
285 | 0 | } |
286 | | |
287 | | |
288 | | |
289 | | } // namespace mozilla |
290 | | namespace mozilla { |
291 | | namespace ipc { |
292 | | auto IPDLParamTraits<mozilla::PProcessHangMonitorParent>::Write( |
293 | | IPC::Message* aMsg, |
294 | | mozilla::ipc::IProtocol* aActor, |
295 | | const paramType& aVar) -> void |
296 | 0 | { |
297 | 0 | int32_t id; |
298 | 0 | if ((!(aVar))) { |
299 | 0 | id = 0; |
300 | 0 | } |
301 | 0 | else { |
302 | 0 | id = (aVar)->Id(); |
303 | 0 | if ((1) == (id)) { |
304 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
305 | 0 | } |
306 | 0 | } |
307 | 0 | WriteIPDLParam(aMsg, aActor, id); |
308 | 0 | } |
309 | | |
310 | | auto IPDLParamTraits<mozilla::PProcessHangMonitorParent>::Read( |
311 | | const IPC::Message* aMsg, |
312 | | PickleIterator* aIter, |
313 | | mozilla::ipc::IProtocol* aActor, |
314 | | paramType* aVar) -> bool |
315 | 0 | { |
316 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PProcessHangMonitor", PProcessHangMonitorMsgStart); |
317 | 0 | if ((actor).isNothing()) { |
318 | 0 | return false; |
319 | 0 | } |
320 | 0 | |
321 | 0 | (*(aVar)) = static_cast<mozilla::PProcessHangMonitorParent*>((actor).value()); |
322 | 0 | return true; |
323 | 0 | } |
324 | | |
325 | | } // namespace ipc |
326 | | } // namespace mozilla |