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