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