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