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