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