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