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