/work/obj-fuzz/ipc/ipdl/PGMPTimerChild.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/gmp/PGMPTimerChild.h" |
8 | | |
9 | | #include "mozilla/gmp/PGMPChild.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace gmp { |
16 | | |
17 | | |
18 | | auto PGMPTimerChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | MOZ_IMPLICIT PGMPTimerChild::PGMPTimerChild() : |
23 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
24 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
25 | 0 | { |
26 | 0 | MOZ_COUNT_CTOR(PGMPTimerChild); |
27 | 0 | } |
28 | | |
29 | | PGMPTimerChild::~PGMPTimerChild() |
30 | 0 | { |
31 | 0 | MOZ_COUNT_DTOR(PGMPTimerChild); |
32 | 0 | } |
33 | | |
34 | | auto PGMPTimerChild::Manager() const -> PGMPChild* |
35 | 0 | { |
36 | 0 | return static_cast<PGMPChild*>(IProtocol::Manager()); |
37 | 0 | } |
38 | | |
39 | | auto PGMPTimerChild::SendSetTimer( |
40 | | const uint32_t& aTimerId, |
41 | | const uint32_t& aTimeoutMs) -> bool |
42 | 0 | { |
43 | 0 | IPC::Message* msg__ = PGMPTimer::Msg_SetTimer(Id()); |
44 | 0 |
|
45 | 0 | WriteIPDLParam(msg__, this, aTimerId); |
46 | 0 | // Sentinel = 'aTimerId' |
47 | 0 | (msg__)->WriteSentinel(3522148191); |
48 | 0 | WriteIPDLParam(msg__, this, aTimeoutMs); |
49 | 0 | // Sentinel = 'aTimeoutMs' |
50 | 0 | (msg__)->WriteSentinel(25578592); |
51 | 0 |
|
52 | 0 |
|
53 | 0 |
|
54 | 0 |
|
55 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPTimerChild")) { |
56 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPTimerChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
57 | 0 | } |
58 | 0 | AUTO_PROFILER_LABEL("PGMPTimer::Msg_SetTimer", OTHER); |
59 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
60 | 0 | mozilla::ipc::LogicError("Transition error"); |
61 | 0 | } |
62 | 0 |
|
63 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
64 | 0 | return sendok__; |
65 | 0 | } |
66 | | |
67 | | auto PGMPTimerChild::Send__delete__(PGMPTimerChild* actor) -> bool |
68 | 0 | { |
69 | 0 | if ((!(actor))) { |
70 | 0 | return false; |
71 | 0 | } |
72 | 0 | |
73 | 0 | IPC::Message* msg__ = PGMPTimer::Msg___delete__((actor)->Id()); |
74 | 0 |
|
75 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
76 | 0 | WriteIPDLParam(msg__, actor, actor); |
77 | 0 | // Sentinel = 'actor' |
78 | 0 | (msg__)->WriteSentinel(875202478); |
79 | 0 |
|
80 | 0 |
|
81 | 0 |
|
82 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPTimerChild")) { |
83 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPTimerChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
84 | 0 | } |
85 | 0 | AUTO_PROFILER_LABEL("PGMPTimer::Msg___delete__", OTHER); |
86 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
87 | 0 | mozilla::ipc::LogicError("Transition error"); |
88 | 0 | } |
89 | 0 |
|
90 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
91 | 0 |
|
92 | 0 | IProtocol* mgr = (actor)->Manager(); |
93 | 0 | (actor)->DestroySubtree(Deletion); |
94 | 0 | (actor)->DeallocSubtree(); |
95 | 0 | (mgr)->RemoveManagee(PGMPTimerMsgStart, actor); |
96 | 0 | return sendok__; |
97 | 0 | } |
98 | | |
99 | | auto PGMPTimerChild::RemoveManagee( |
100 | | int32_t aProtocolId, |
101 | | IProtocol* aListener) -> void |
102 | 0 | { |
103 | 0 | FatalError("unreached"); |
104 | 0 | return; |
105 | 0 | } |
106 | | |
107 | | auto PGMPTimerChild::OnMessageReceived(const Message& msg__) -> PGMPTimerChild::Result |
108 | 0 | { |
109 | 0 | switch ((msg__).type()) { |
110 | 0 | case PGMPTimer::Msg_TimerExpired__ID: |
111 | 0 | { |
112 | 0 | if (mozilla::ipc::LoggingEnabledFor("PGMPTimerChild")) { |
113 | 0 | mozilla::ipc::LogMessageForProtocol("PGMPTimerChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
114 | 0 | } |
115 | 0 | AUTO_PROFILER_LABEL("PGMPTimer::Msg_TimerExpired", OTHER); |
116 | 0 |
|
117 | 0 | PickleIterator iter__(msg__); |
118 | 0 | uint32_t aTimerId; |
119 | 0 |
|
120 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTimerId)))))) { |
121 | 0 | FatalError("Error deserializing 'uint32_t'"); |
122 | 0 | return MsgValueError; |
123 | 0 | } |
124 | 0 | // Sentinel = 'aTimerId' |
125 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3522148191)))) { |
126 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
127 | 0 | return MsgValueError; |
128 | 0 | } |
129 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
130 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
131 | 0 | FatalError("Transition error"); |
132 | 0 | return MsgValueError; |
133 | 0 | } |
134 | 0 | if ((!(RecvTimerExpired(aTimerId)))) { |
135 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
136 | 0 | // Error handled in mozilla::ipc::IPCResult |
137 | 0 | return MsgProcessingError; |
138 | 0 | } |
139 | 0 | |
140 | 0 | return MsgProcessed; |
141 | 0 | } |
142 | 0 | case PGMPTimer::Reply___delete____ID: |
143 | 0 | { |
144 | 0 | return MsgProcessed; |
145 | 0 | } |
146 | 0 | default: |
147 | 0 | { |
148 | 0 | return MsgNotKnown; |
149 | 0 | } |
150 | 0 | } |
151 | 0 | } |
152 | | |
153 | | auto PGMPTimerChild::OnMessageReceived( |
154 | | const Message& msg__, |
155 | | Message*& reply__) -> PGMPTimerChild::Result |
156 | 0 | { |
157 | 0 | return MsgNotKnown; |
158 | 0 | } |
159 | | |
160 | | auto PGMPTimerChild::OnCallReceived( |
161 | | const Message& msg__, |
162 | | Message*& reply__) -> PGMPTimerChild::Result |
163 | 0 | { |
164 | 0 | return MsgNotKnown; |
165 | 0 | } |
166 | | |
167 | | auto PGMPTimerChild::GetProtocolTypeId() -> int32_t |
168 | 0 | { |
169 | 0 | return PGMPTimerMsgStart; |
170 | 0 | } |
171 | | |
172 | | auto PGMPTimerChild::DestroySubtree(ActorDestroyReason why) -> void |
173 | 0 | { |
174 | 0 | // Unregister from our manager. |
175 | 0 | Unregister(Id()); |
176 | 0 |
|
177 | 0 | // Reject owning pending responses. |
178 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
179 | 0 |
|
180 | 0 | // Finally, destroy "us". |
181 | 0 | ActorDestroy(why); |
182 | 0 | } |
183 | | |
184 | | auto PGMPTimerChild::DeallocSubtree() -> void |
185 | 0 | { |
186 | 0 | } |
187 | | |
188 | | |
189 | | |
190 | | } // namespace gmp |
191 | | } // namespace mozilla |
192 | | namespace mozilla { |
193 | | namespace ipc { |
194 | | auto IPDLParamTraits<mozilla::gmp::PGMPTimerChild>::Write( |
195 | | IPC::Message* aMsg, |
196 | | mozilla::ipc::IProtocol* aActor, |
197 | | const paramType& aVar) -> void |
198 | 0 | { |
199 | 0 | int32_t id; |
200 | 0 | if ((!(aVar))) { |
201 | 0 | id = 0; |
202 | 0 | } |
203 | 0 | else { |
204 | 0 | id = (aVar)->Id(); |
205 | 0 | if ((1) == (id)) { |
206 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
207 | 0 | } |
208 | 0 | } |
209 | 0 | WriteIPDLParam(aMsg, aActor, id); |
210 | 0 | } |
211 | | |
212 | | auto IPDLParamTraits<mozilla::gmp::PGMPTimerChild>::Read( |
213 | | const IPC::Message* aMsg, |
214 | | PickleIterator* aIter, |
215 | | mozilla::ipc::IProtocol* aActor, |
216 | | paramType* aVar) -> bool |
217 | 0 | { |
218 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PGMPTimer", PGMPTimerMsgStart); |
219 | 0 | if ((actor).isNothing()) { |
220 | 0 | return false; |
221 | 0 | } |
222 | 0 | |
223 | 0 | (*(aVar)) = static_cast<mozilla::gmp::PGMPTimerChild*>((actor).value()); |
224 | 0 | return true; |
225 | 0 | } |
226 | | |
227 | | } // namespace ipc |
228 | | } // namespace mozilla |