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