/work/obj-fuzz/ipc/ipdl/PStreamNotifyParent.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/plugins/PStreamNotifyParent.h" |
8 | | |
9 | | #include "mozilla/plugins/PPluginInstanceParent.h" |
10 | | |
11 | | #include "nsIFile.h" |
12 | | #include "GeckoProfiler.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace plugins { |
16 | | |
17 | | |
18 | | auto PStreamNotifyParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | | MOZ_IMPLICIT PStreamNotifyParent::PStreamNotifyParent() : |
23 | | mozilla::ipc::IProtocol(mozilla::ipc::ParentSide), |
24 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
25 | 0 | { |
26 | 0 | MOZ_COUNT_CTOR(PStreamNotifyParent); |
27 | 0 | } |
28 | | |
29 | | PStreamNotifyParent::~PStreamNotifyParent() |
30 | 0 | { |
31 | 0 | MOZ_COUNT_DTOR(PStreamNotifyParent); |
32 | 0 | } |
33 | | |
34 | | auto PStreamNotifyParent::Manager() const -> PPluginInstanceParent* |
35 | 0 | { |
36 | 0 | return static_cast<PPluginInstanceParent*>(IProtocol::Manager()); |
37 | 0 | } |
38 | | |
39 | | auto PStreamNotifyParent::SendRedirectNotify( |
40 | | const nsCString& url, |
41 | | const int32_t& status) -> bool |
42 | 0 | { |
43 | 0 | IPC::Message* msg__ = PStreamNotify::Msg_RedirectNotify(Id()); |
44 | 0 |
|
45 | 0 | WriteIPDLParam(msg__, this, url); |
46 | 0 | // Sentinel = 'url' |
47 | 0 | (msg__)->WriteSentinel(1453210600); |
48 | 0 | WriteIPDLParam(msg__, this, status); |
49 | 0 | // Sentinel = 'status' |
50 | 0 | (msg__)->WriteSentinel(3714608576); |
51 | 0 |
|
52 | 0 |
|
53 | 0 |
|
54 | 0 |
|
55 | 0 | if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyParent")) { |
56 | 0 | mozilla::ipc::LogMessageForProtocol("PStreamNotifyParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
57 | 0 | } |
58 | 0 | AUTO_PROFILER_LABEL("PStreamNotify::Msg_RedirectNotify", 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 PStreamNotifyParent::Send__delete__( |
68 | | PStreamNotifyParent* actor, |
69 | | const NPReason& reason) -> bool |
70 | 0 | { |
71 | 0 | if ((!(actor))) { |
72 | 0 | return false; |
73 | 0 | } |
74 | 0 | |
75 | 0 | IPC::Message* msg__ = PStreamNotify::Msg___delete__((actor)->Id()); |
76 | 0 |
|
77 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
78 | 0 | WriteIPDLParam(msg__, actor, actor); |
79 | 0 | // Sentinel = 'actor' |
80 | 0 | (msg__)->WriteSentinel(875202478); |
81 | 0 | WriteIPDLParam(msg__, actor, reason); |
82 | 0 | // Sentinel = 'reason' |
83 | 0 | (msg__)->WriteSentinel(4151390930); |
84 | 0 |
|
85 | 0 |
|
86 | 0 |
|
87 | 0 | if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyParent")) { |
88 | 0 | mozilla::ipc::LogMessageForProtocol("PStreamNotifyParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
89 | 0 | } |
90 | 0 | AUTO_PROFILER_LABEL("PStreamNotify::Msg___delete__", OTHER); |
91 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
92 | 0 | mozilla::ipc::LogicError("Transition error"); |
93 | 0 | } |
94 | 0 |
|
95 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
96 | 0 |
|
97 | 0 | IProtocol* mgr = (actor)->Manager(); |
98 | 0 | (actor)->DestroySubtree(Deletion); |
99 | 0 | (actor)->DeallocSubtree(); |
100 | 0 | (mgr)->RemoveManagee(PStreamNotifyMsgStart, actor); |
101 | 0 | return sendok__; |
102 | 0 | } |
103 | | |
104 | | auto PStreamNotifyParent::RemoveManagee( |
105 | | int32_t aProtocolId, |
106 | | IProtocol* aListener) -> void |
107 | 0 | { |
108 | 0 | FatalError("unreached"); |
109 | 0 | return; |
110 | 0 | } |
111 | | |
112 | | auto PStreamNotifyParent::OnMessageReceived(const Message& msg__) -> PStreamNotifyParent::Result |
113 | 0 | { |
114 | 0 | switch ((msg__).type()) { |
115 | 0 | case PStreamNotify::Msg_RedirectNotifyResponse__ID: |
116 | 0 | { |
117 | 0 | if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyParent")) { |
118 | 0 | mozilla::ipc::LogMessageForProtocol("PStreamNotifyParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
119 | 0 | } |
120 | 0 | AUTO_PROFILER_LABEL("PStreamNotify::Msg_RedirectNotifyResponse", OTHER); |
121 | 0 |
|
122 | 0 | PickleIterator iter__(msg__); |
123 | 0 | bool allow; |
124 | 0 |
|
125 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(allow)))))) { |
126 | 0 | FatalError("Error deserializing 'bool'"); |
127 | 0 | return MsgValueError; |
128 | 0 | } |
129 | 0 | // Sentinel = 'allow' |
130 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3737033206)))) { |
131 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
132 | 0 | return MsgValueError; |
133 | 0 | } |
134 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
135 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
136 | 0 | FatalError("Transition error"); |
137 | 0 | return MsgValueError; |
138 | 0 | } |
139 | 0 | if ((!(RecvRedirectNotifyResponse(allow)))) { |
140 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
141 | 0 | // Error handled in mozilla::ipc::IPCResult |
142 | 0 | return MsgProcessingError; |
143 | 0 | } |
144 | 0 | |
145 | 0 | return MsgProcessed; |
146 | 0 | } |
147 | 0 | case PStreamNotify::Reply___delete____ID: |
148 | 0 | { |
149 | 0 | return MsgProcessed; |
150 | 0 | } |
151 | 0 | default: |
152 | 0 | { |
153 | 0 | return MsgNotKnown; |
154 | 0 | } |
155 | 0 | } |
156 | 0 | } |
157 | | |
158 | | auto PStreamNotifyParent::OnMessageReceived( |
159 | | const Message& msg__, |
160 | | Message*& reply__) -> PStreamNotifyParent::Result |
161 | 0 | { |
162 | 0 | return MsgNotKnown; |
163 | 0 | } |
164 | | |
165 | | auto PStreamNotifyParent::OnCallReceived( |
166 | | const Message& msg__, |
167 | | Message*& reply__) -> PStreamNotifyParent::Result |
168 | 0 | { |
169 | 0 | return MsgNotKnown; |
170 | 0 | } |
171 | | |
172 | | auto PStreamNotifyParent::GetProtocolTypeId() -> int32_t |
173 | 0 | { |
174 | 0 | return PStreamNotifyMsgStart; |
175 | 0 | } |
176 | | |
177 | | auto PStreamNotifyParent::DestroySubtree(ActorDestroyReason why) -> void |
178 | 0 | { |
179 | 0 | // Unregister from our manager. |
180 | 0 | Unregister(Id()); |
181 | 0 |
|
182 | 0 | // Reject owning pending responses. |
183 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
184 | 0 |
|
185 | 0 | // Finally, destroy "us". |
186 | 0 | ActorDestroy(why); |
187 | 0 | } |
188 | | |
189 | | auto PStreamNotifyParent::DeallocSubtree() -> void |
190 | 0 | { |
191 | 0 | } |
192 | | |
193 | | |
194 | | |
195 | | } // namespace plugins |
196 | | } // namespace mozilla |
197 | | namespace mozilla { |
198 | | namespace ipc { |
199 | | auto IPDLParamTraits<mozilla::plugins::PStreamNotifyParent>::Write( |
200 | | IPC::Message* aMsg, |
201 | | mozilla::ipc::IProtocol* aActor, |
202 | | const paramType& aVar) -> void |
203 | 0 | { |
204 | 0 | int32_t id; |
205 | 0 | if ((!(aVar))) { |
206 | 0 | id = 0; |
207 | 0 | } |
208 | 0 | else { |
209 | 0 | id = (aVar)->Id(); |
210 | 0 | if ((1) == (id)) { |
211 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
212 | 0 | } |
213 | 0 | } |
214 | 0 | WriteIPDLParam(aMsg, aActor, id); |
215 | 0 | } |
216 | | |
217 | | auto IPDLParamTraits<mozilla::plugins::PStreamNotifyParent>::Read( |
218 | | const IPC::Message* aMsg, |
219 | | PickleIterator* aIter, |
220 | | mozilla::ipc::IProtocol* aActor, |
221 | | paramType* aVar) -> bool |
222 | 0 | { |
223 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PStreamNotify", PStreamNotifyMsgStart); |
224 | 0 | if ((actor).isNothing()) { |
225 | 0 | return false; |
226 | 0 | } |
227 | 0 | |
228 | 0 | (*(aVar)) = static_cast<mozilla::plugins::PStreamNotifyParent*>((actor).value()); |
229 | 0 | return true; |
230 | 0 | } |
231 | | |
232 | | } // namespace ipc |
233 | | } // namespace mozilla |