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