Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PTCPServerSocketChild.h"
8 :
9 : #include "mozilla/net/PNeckoChild.h"
10 : #include "mozilla/net/PTCPSocketChild.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace net {
17 :
18 :
19 0 : auto PTCPServerSocketChild::Recv__delete__() -> mozilla::ipc::IPCResult
20 : {
21 0 : return IPC_OK();
22 : }
23 :
24 0 : auto PTCPServerSocketChild::ActorDestroy(ActorDestroyReason aWhy) -> void
25 : {
26 0 : }
27 :
28 0 : MOZ_IMPLICIT PTCPServerSocketChild::PTCPServerSocketChild() :
29 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
30 0 : mState(PTCPServerSocket::__Dead)
31 : {
32 0 : MOZ_COUNT_CTOR(PTCPServerSocketChild);
33 0 : }
34 :
35 0 : PTCPServerSocketChild::~PTCPServerSocketChild()
36 : {
37 0 : MOZ_COUNT_DTOR(PTCPServerSocketChild);
38 0 : }
39 :
40 0 : auto PTCPServerSocketChild::Manager() const -> PNeckoChild*
41 : {
42 0 : return static_cast<PNeckoChild*>(IProtocol::Manager());
43 : }
44 :
45 0 : auto PTCPServerSocketChild::SendClose() -> bool
46 : {
47 0 : IPC::Message* msg__ = PTCPServerSocket::Msg_Close(Id());
48 :
49 :
50 :
51 :
52 :
53 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPServerSocketChild")) {
54 0 : mozilla::ipc::LogMessageForProtocol("PTCPServerSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
55 : }
56 0 : AUTO_PROFILER_LABEL("PTCPServerSocket::Msg_Close", OTHER);
57 0 : PTCPServerSocket::Transition(PTCPServerSocket::Msg_Close__ID, (&(mState)));
58 :
59 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
60 0 : return sendok__;
61 : }
62 :
63 0 : auto PTCPServerSocketChild::SendRequestDelete() -> bool
64 : {
65 0 : IPC::Message* msg__ = PTCPServerSocket::Msg_RequestDelete(Id());
66 :
67 :
68 :
69 :
70 :
71 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPServerSocketChild")) {
72 0 : mozilla::ipc::LogMessageForProtocol("PTCPServerSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
73 : }
74 0 : AUTO_PROFILER_LABEL("PTCPServerSocket::Msg_RequestDelete", OTHER);
75 0 : PTCPServerSocket::Transition(PTCPServerSocket::Msg_RequestDelete__ID, (&(mState)));
76 :
77 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
78 0 : return sendok__;
79 : }
80 :
81 0 : auto PTCPServerSocketChild::RemoveManagee(
82 : int32_t aProtocolId,
83 : ProtocolBase* aListener) -> void
84 : {
85 0 : FatalError("unreached");
86 0 : return;
87 : }
88 :
89 0 : auto PTCPServerSocketChild::OnMessageReceived(const Message& msg__) -> PTCPServerSocketChild::Result
90 : {
91 0 : switch ((msg__).type()) {
92 : case PTCPServerSocket::Msg_CallbackAccept__ID:
93 : {
94 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPServerSocketChild")) {
95 0 : mozilla::ipc::LogMessageForProtocol("PTCPServerSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
96 : }
97 0 : AUTO_PROFILER_LABEL("PTCPServerSocket::Msg_CallbackAccept", OTHER);
98 :
99 0 : PickleIterator iter__(msg__);
100 : PTCPSocketChild* socket;
101 :
102 0 : if ((!(Read((&(socket)), (&(msg__)), (&(iter__)), false)))) {
103 0 : FatalError("Error deserializing 'PTCPSocketChild'");
104 0 : return MsgValueError;
105 : }
106 : // Sentinel = 'socket'
107 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3619774181)))) {
108 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PTCPSocketChild'");
109 0 : return MsgValueError;
110 : }
111 0 : (msg__).EndRead(iter__, (msg__).type());
112 0 : PTCPServerSocket::Transition(PTCPServerSocket::Msg_CallbackAccept__ID, (&(mState)));
113 0 : if ((!(RecvCallbackAccept(mozilla::Move(socket))))) {
114 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
115 : // Error handled in mozilla::ipc::IPCResult
116 0 : return MsgProcessingError;
117 : }
118 :
119 0 : return MsgProcessed;
120 : }
121 : case PTCPServerSocket::Msg___delete____ID:
122 : {
123 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPServerSocketChild")) {
124 0 : mozilla::ipc::LogMessageForProtocol("PTCPServerSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
125 : }
126 0 : AUTO_PROFILER_LABEL("PTCPServerSocket::Msg___delete__", OTHER);
127 :
128 0 : PickleIterator iter__(msg__);
129 : PTCPServerSocketChild* actor;
130 :
131 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
132 0 : FatalError("Error deserializing 'PTCPServerSocketChild'");
133 0 : return MsgValueError;
134 : }
135 : // Sentinel = 'actor'
136 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
137 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PTCPServerSocketChild'");
138 0 : return MsgValueError;
139 : }
140 0 : (msg__).EndRead(iter__, (msg__).type());
141 0 : PTCPServerSocket::Transition(PTCPServerSocket::Msg___delete____ID, (&(mState)));
142 0 : if ((!(Recv__delete__()))) {
143 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
144 : // Error handled in mozilla::ipc::IPCResult
145 0 : return MsgProcessingError;
146 : }
147 :
148 :
149 0 : IProtocol* mgr = (actor)->Manager();
150 0 : (actor)->DestroySubtree(Deletion);
151 0 : (actor)->DeallocSubtree();
152 0 : (mgr)->RemoveManagee(PTCPServerSocketMsgStart, actor);
153 :
154 0 : return MsgProcessed;
155 : }
156 : default:
157 : {
158 0 : return MsgNotKnown;
159 : }
160 : }
161 : }
162 :
163 0 : auto PTCPServerSocketChild::OnMessageReceived(
164 : const Message& msg__,
165 : Message*& reply__) -> PTCPServerSocketChild::Result
166 : {
167 0 : return MsgNotKnown;
168 : }
169 :
170 0 : auto PTCPServerSocketChild::OnCallReceived(
171 : const Message& msg__,
172 : Message*& reply__) -> PTCPServerSocketChild::Result
173 : {
174 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
175 : return MsgNotKnown;
176 : }
177 :
178 0 : auto PTCPServerSocketChild::GetProtocolTypeId() -> int32_t
179 : {
180 0 : return PTCPServerSocketMsgStart;
181 : }
182 :
183 0 : auto PTCPServerSocketChild::ProtocolName() const -> const char*
184 : {
185 0 : return "PTCPServerSocketChild";
186 : }
187 :
188 0 : auto PTCPServerSocketChild::DestroySubtree(ActorDestroyReason why) -> void
189 : {
190 : // Unregister from our manager.
191 0 : Unregister(Id());
192 :
193 : // Reject owning pending promises.
194 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
195 :
196 : // Finally, destroy "us".
197 0 : ActorDestroy(why);
198 0 : }
199 :
200 0 : auto PTCPServerSocketChild::DeallocSubtree() -> void
201 : {
202 0 : }
203 :
204 0 : auto PTCPServerSocketChild::Write(
205 : const PTCPServerSocketChild* v__,
206 : Message* msg__,
207 : bool nullable__) -> void
208 : {
209 : int32_t id;
210 0 : if ((!(v__))) {
211 0 : if ((!(nullable__))) {
212 0 : FatalError("NULL actor value passed to non-nullable param");
213 : }
214 0 : id = 0;
215 : }
216 : else {
217 0 : id = (v__)->Id();
218 0 : if ((1) == (id)) {
219 0 : FatalError("actor has been |delete|d");
220 : }
221 : }
222 :
223 0 : Write(id, msg__);
224 0 : }
225 :
226 0 : auto PTCPServerSocketChild::Read(
227 : PTCPServerSocketChild** v__,
228 : const Message* msg__,
229 : PickleIterator* iter__,
230 : bool nullable__) -> bool
231 : {
232 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PTCPServerSocket", PTCPServerSocketMsgStart);
233 0 : if ((actor).isNothing()) {
234 0 : return false;
235 : }
236 :
237 0 : (*(v__)) = static_cast<PTCPServerSocketChild*>((actor).value());
238 0 : return true;
239 : }
240 :
241 0 : auto PTCPServerSocketChild::Write(
242 : const PTCPSocketChild* v__,
243 : Message* msg__,
244 : bool nullable__) -> void
245 : {
246 : int32_t id;
247 0 : if ((!(v__))) {
248 0 : if ((!(nullable__))) {
249 0 : FatalError("NULL actor value passed to non-nullable param");
250 : }
251 0 : id = 0;
252 : }
253 : else {
254 0 : id = (v__)->Id();
255 0 : if ((1) == (id)) {
256 0 : FatalError("actor has been |delete|d");
257 : }
258 : }
259 :
260 0 : Write(id, msg__);
261 0 : }
262 :
263 0 : auto PTCPServerSocketChild::Read(
264 : PTCPSocketChild** v__,
265 : const Message* msg__,
266 : PickleIterator* iter__,
267 : bool nullable__) -> bool
268 : {
269 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PTCPSocket", PTCPSocketMsgStart);
270 0 : if ((actor).isNothing()) {
271 0 : return false;
272 : }
273 :
274 0 : (*(v__)) = static_cast<PTCPSocketChild*>((actor).value());
275 0 : return true;
276 : }
277 :
278 :
279 :
280 : } // namespace net
281 : } // namespace mozilla
|