1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/common/commit_data_request.proto
3
4 #include "protos/perfetto/common/commit_data_request.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
CommitDataRequest_ChunksToMove(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.page_)*/0u
29 , /*decltype(_impl_.chunk_)*/0u
30 , /*decltype(_impl_.target_buffer_)*/0u} {}
31 struct CommitDataRequest_ChunksToMoveDefaultTypeInternal {
CommitDataRequest_ChunksToMoveDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunksToMoveDefaultTypeInternal32 PROTOBUF_CONSTEXPR CommitDataRequest_ChunksToMoveDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~CommitDataRequest_ChunksToMoveDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunksToMoveDefaultTypeInternal34 ~CommitDataRequest_ChunksToMoveDefaultTypeInternal() {}
35 union { // NOLINT(misc-non-private-member-variables-in-classes)
36 CommitDataRequest_ChunksToMove _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommitDataRequest_ChunksToMoveDefaultTypeInternal _CommitDataRequest_ChunksToMove_default_instance_;
CommitDataRequest_ChunkToPatch_Patch(::_pbi::ConstantInitialized)40 PROTOBUF_CONSTEXPR CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch(
41 ::_pbi::ConstantInitialized): _impl_{
42 /*decltype(_impl_._has_bits_)*/{}
43 , /*decltype(_impl_._cached_size_)*/{}
44 , /*decltype(_impl_.data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
45 , /*decltype(_impl_.offset_)*/0u} {}
46 struct CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal {
CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal47 PROTOBUF_CONSTEXPR CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal49 ~CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 CommitDataRequest_ChunkToPatch_Patch _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommitDataRequest_ChunkToPatch_PatchDefaultTypeInternal _CommitDataRequest_ChunkToPatch_Patch_default_instance_;
CommitDataRequest_ChunkToPatch(::_pbi::ConstantInitialized)55 PROTOBUF_CONSTEXPR CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch(
56 ::_pbi::ConstantInitialized): _impl_{
57 /*decltype(_impl_._has_bits_)*/{}
58 , /*decltype(_impl_._cached_size_)*/{}
59 , /*decltype(_impl_.patches_)*/{}
60 , /*decltype(_impl_.target_buffer_)*/0u
61 , /*decltype(_impl_.writer_id_)*/0u
62 , /*decltype(_impl_.chunk_id_)*/0u
63 , /*decltype(_impl_.has_more_patches_)*/false} {}
64 struct CommitDataRequest_ChunkToPatchDefaultTypeInternal {
CommitDataRequest_ChunkToPatchDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunkToPatchDefaultTypeInternal65 PROTOBUF_CONSTEXPR CommitDataRequest_ChunkToPatchDefaultTypeInternal()
66 : _instance(::_pbi::ConstantInitialized{}) {}
~CommitDataRequest_ChunkToPatchDefaultTypeInternalperfetto::protos::CommitDataRequest_ChunkToPatchDefaultTypeInternal67 ~CommitDataRequest_ChunkToPatchDefaultTypeInternal() {}
68 union { // NOLINT(misc-non-private-member-variables-in-classes)
69 CommitDataRequest_ChunkToPatch _instance;
70 };
71 };
72 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommitDataRequest_ChunkToPatchDefaultTypeInternal _CommitDataRequest_ChunkToPatch_default_instance_;
CommitDataRequest(::_pbi::ConstantInitialized)73 PROTOBUF_CONSTEXPR CommitDataRequest::CommitDataRequest(
74 ::_pbi::ConstantInitialized): _impl_{
75 /*decltype(_impl_._has_bits_)*/{}
76 , /*decltype(_impl_._cached_size_)*/{}
77 , /*decltype(_impl_.chunks_to_move_)*/{}
78 , /*decltype(_impl_.chunks_to_patch_)*/{}
79 , /*decltype(_impl_.flush_request_id_)*/::uint64_t{0u}} {}
80 struct CommitDataRequestDefaultTypeInternal {
CommitDataRequestDefaultTypeInternalperfetto::protos::CommitDataRequestDefaultTypeInternal81 PROTOBUF_CONSTEXPR CommitDataRequestDefaultTypeInternal()
82 : _instance(::_pbi::ConstantInitialized{}) {}
~CommitDataRequestDefaultTypeInternalperfetto::protos::CommitDataRequestDefaultTypeInternal83 ~CommitDataRequestDefaultTypeInternal() {}
84 union { // NOLINT(misc-non-private-member-variables-in-classes)
85 CommitDataRequest _instance;
86 };
87 };
88 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CommitDataRequestDefaultTypeInternal _CommitDataRequest_default_instance_;
89 } // namespace protos
90 } // namespace perfetto
91 namespace perfetto {
92 namespace protos {
93
94 // ===================================================================
95
96 class CommitDataRequest_ChunksToMove::_Internal {
97 public:
98 using HasBits = decltype(std::declval<CommitDataRequest_ChunksToMove>()._impl_._has_bits_);
set_has_page(HasBits * has_bits)99 static void set_has_page(HasBits* has_bits) {
100 (*has_bits)[0] |= 2u;
101 }
set_has_chunk(HasBits * has_bits)102 static void set_has_chunk(HasBits* has_bits) {
103 (*has_bits)[0] |= 4u;
104 }
set_has_target_buffer(HasBits * has_bits)105 static void set_has_target_buffer(HasBits* has_bits) {
106 (*has_bits)[0] |= 8u;
107 }
set_has_data(HasBits * has_bits)108 static void set_has_data(HasBits* has_bits) {
109 (*has_bits)[0] |= 1u;
110 }
111 };
112
CommitDataRequest_ChunksToMove(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)113 CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove(::PROTOBUF_NAMESPACE_ID::Arena* arena,
114 bool is_message_owned)
115 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
116 SharedCtor(arena, is_message_owned);
117 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CommitDataRequest.ChunksToMove)
118 }
CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove & from)119 CommitDataRequest_ChunksToMove::CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove& from)
120 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
121 CommitDataRequest_ChunksToMove* const _this = this; (void)_this;
122 new (&_impl_) Impl_{
123 decltype(_impl_._has_bits_){from._impl_._has_bits_}
124 , /*decltype(_impl_._cached_size_)*/{}
125 , decltype(_impl_.data_){}
126 , decltype(_impl_.page_){}
127 , decltype(_impl_.chunk_){}
128 , decltype(_impl_.target_buffer_){}};
129
130 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
131 _impl_.data_.InitDefault();
132 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
133 _impl_.data_.Set("", GetArenaForAllocation());
134 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
135 if (from._internal_has_data()) {
136 _this->_impl_.data_.Set(from._internal_data(),
137 _this->GetArenaForAllocation());
138 }
139 ::memcpy(&_impl_.page_, &from._impl_.page_,
140 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.target_buffer_) -
141 reinterpret_cast<char*>(&_impl_.page_)) + sizeof(_impl_.target_buffer_));
142 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CommitDataRequest.ChunksToMove)
143 }
144
SharedCtor(::_pb::Arena * arena,bool is_message_owned)145 inline void CommitDataRequest_ChunksToMove::SharedCtor(
146 ::_pb::Arena* arena, bool is_message_owned) {
147 (void)arena;
148 (void)is_message_owned;
149 new (&_impl_) Impl_{
150 decltype(_impl_._has_bits_){}
151 , /*decltype(_impl_._cached_size_)*/{}
152 , decltype(_impl_.data_){}
153 , decltype(_impl_.page_){0u}
154 , decltype(_impl_.chunk_){0u}
155 , decltype(_impl_.target_buffer_){0u}
156 };
157 _impl_.data_.InitDefault();
158 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
159 _impl_.data_.Set("", GetArenaForAllocation());
160 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
161 }
162
~CommitDataRequest_ChunksToMove()163 CommitDataRequest_ChunksToMove::~CommitDataRequest_ChunksToMove() {
164 // @@protoc_insertion_point(destructor:perfetto.protos.CommitDataRequest.ChunksToMove)
165 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
166 (void)arena;
167 return;
168 }
169 SharedDtor();
170 }
171
SharedDtor()172 inline void CommitDataRequest_ChunksToMove::SharedDtor() {
173 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
174 _impl_.data_.Destroy();
175 }
176
SetCachedSize(int size) const177 void CommitDataRequest_ChunksToMove::SetCachedSize(int size) const {
178 _impl_._cached_size_.Set(size);
179 }
180
Clear()181 void CommitDataRequest_ChunksToMove::Clear() {
182 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CommitDataRequest.ChunksToMove)
183 ::uint32_t cached_has_bits = 0;
184 // Prevent compiler warnings about cached_has_bits being unused
185 (void) cached_has_bits;
186
187 cached_has_bits = _impl_._has_bits_[0];
188 if (cached_has_bits & 0x00000001u) {
189 _impl_.data_.ClearNonDefaultToEmpty();
190 }
191 if (cached_has_bits & 0x0000000eu) {
192 ::memset(&_impl_.page_, 0, static_cast<size_t>(
193 reinterpret_cast<char*>(&_impl_.target_buffer_) -
194 reinterpret_cast<char*>(&_impl_.page_)) + sizeof(_impl_.target_buffer_));
195 }
196 _impl_._has_bits_.Clear();
197 _internal_metadata_.Clear<std::string>();
198 }
199
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)200 const char* CommitDataRequest_ChunksToMove::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
201 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
202 _Internal::HasBits has_bits{};
203 while (!ctx->Done(&ptr)) {
204 ::uint32_t tag;
205 ptr = ::_pbi::ReadTag(ptr, &tag);
206 switch (tag >> 3) {
207 // optional uint32 page = 1;
208 case 1:
209 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
210 _Internal::set_has_page(&has_bits);
211 _impl_.page_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
212 CHK_(ptr);
213 } else {
214 goto handle_unusual;
215 }
216 continue;
217 // optional uint32 chunk = 2;
218 case 2:
219 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
220 _Internal::set_has_chunk(&has_bits);
221 _impl_.chunk_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
222 CHK_(ptr);
223 } else {
224 goto handle_unusual;
225 }
226 continue;
227 // optional uint32 target_buffer = 3;
228 case 3:
229 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
230 _Internal::set_has_target_buffer(&has_bits);
231 _impl_.target_buffer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
232 CHK_(ptr);
233 } else {
234 goto handle_unusual;
235 }
236 continue;
237 // optional bytes data = 4;
238 case 4:
239 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
240 auto str = _internal_mutable_data();
241 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
242 CHK_(ptr);
243 } else {
244 goto handle_unusual;
245 }
246 continue;
247 default:
248 goto handle_unusual;
249 } // switch
250 handle_unusual:
251 if ((tag == 0) || ((tag & 7) == 4)) {
252 CHK_(ptr);
253 ctx->SetLastTag(tag);
254 goto message_done;
255 }
256 ptr = UnknownFieldParse(
257 tag,
258 _internal_metadata_.mutable_unknown_fields<std::string>(),
259 ptr, ctx);
260 CHK_(ptr != nullptr);
261 } // while
262 message_done:
263 _impl_._has_bits_.Or(has_bits);
264 return ptr;
265 failure:
266 ptr = nullptr;
267 goto message_done;
268 #undef CHK_
269 }
270
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const271 ::uint8_t* CommitDataRequest_ChunksToMove::_InternalSerialize(
272 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
273 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CommitDataRequest.ChunksToMove)
274 ::uint32_t cached_has_bits = 0;
275 (void) cached_has_bits;
276
277 cached_has_bits = _impl_._has_bits_[0];
278 // optional uint32 page = 1;
279 if (cached_has_bits & 0x00000002u) {
280 target = stream->EnsureSpace(target);
281 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_page(), target);
282 }
283
284 // optional uint32 chunk = 2;
285 if (cached_has_bits & 0x00000004u) {
286 target = stream->EnsureSpace(target);
287 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_chunk(), target);
288 }
289
290 // optional uint32 target_buffer = 3;
291 if (cached_has_bits & 0x00000008u) {
292 target = stream->EnsureSpace(target);
293 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_target_buffer(), target);
294 }
295
296 // optional bytes data = 4;
297 if (cached_has_bits & 0x00000001u) {
298 target = stream->WriteBytesMaybeAliased(
299 4, this->_internal_data(), target);
300 }
301
302 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
303 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
304 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
305 }
306 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CommitDataRequest.ChunksToMove)
307 return target;
308 }
309
ByteSizeLong() const310 size_t CommitDataRequest_ChunksToMove::ByteSizeLong() const {
311 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CommitDataRequest.ChunksToMove)
312 size_t total_size = 0;
313
314 ::uint32_t cached_has_bits = 0;
315 // Prevent compiler warnings about cached_has_bits being unused
316 (void) cached_has_bits;
317
318 cached_has_bits = _impl_._has_bits_[0];
319 if (cached_has_bits & 0x0000000fu) {
320 // optional bytes data = 4;
321 if (cached_has_bits & 0x00000001u) {
322 total_size += 1 +
323 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
324 this->_internal_data());
325 }
326
327 // optional uint32 page = 1;
328 if (cached_has_bits & 0x00000002u) {
329 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_page());
330 }
331
332 // optional uint32 chunk = 2;
333 if (cached_has_bits & 0x00000004u) {
334 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_chunk());
335 }
336
337 // optional uint32 target_buffer = 3;
338 if (cached_has_bits & 0x00000008u) {
339 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_target_buffer());
340 }
341
342 }
343 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
344 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
345 }
346 int cached_size = ::_pbi::ToCachedSize(total_size);
347 SetCachedSize(cached_size);
348 return total_size;
349 }
350
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)351 void CommitDataRequest_ChunksToMove::CheckTypeAndMergeFrom(
352 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
353 MergeFrom(*::_pbi::DownCast<const CommitDataRequest_ChunksToMove*>(
354 &from));
355 }
356
MergeFrom(const CommitDataRequest_ChunksToMove & from)357 void CommitDataRequest_ChunksToMove::MergeFrom(const CommitDataRequest_ChunksToMove& from) {
358 CommitDataRequest_ChunksToMove* const _this = this;
359 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CommitDataRequest.ChunksToMove)
360 GOOGLE_DCHECK_NE(&from, _this);
361 ::uint32_t cached_has_bits = 0;
362 (void) cached_has_bits;
363
364 cached_has_bits = from._impl_._has_bits_[0];
365 if (cached_has_bits & 0x0000000fu) {
366 if (cached_has_bits & 0x00000001u) {
367 _this->_internal_set_data(from._internal_data());
368 }
369 if (cached_has_bits & 0x00000002u) {
370 _this->_impl_.page_ = from._impl_.page_;
371 }
372 if (cached_has_bits & 0x00000004u) {
373 _this->_impl_.chunk_ = from._impl_.chunk_;
374 }
375 if (cached_has_bits & 0x00000008u) {
376 _this->_impl_.target_buffer_ = from._impl_.target_buffer_;
377 }
378 _this->_impl_._has_bits_[0] |= cached_has_bits;
379 }
380 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
381 }
382
CopyFrom(const CommitDataRequest_ChunksToMove & from)383 void CommitDataRequest_ChunksToMove::CopyFrom(const CommitDataRequest_ChunksToMove& from) {
384 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CommitDataRequest.ChunksToMove)
385 if (&from == this) return;
386 Clear();
387 MergeFrom(from);
388 }
389
IsInitialized() const390 bool CommitDataRequest_ChunksToMove::IsInitialized() const {
391 return true;
392 }
393
InternalSwap(CommitDataRequest_ChunksToMove * other)394 void CommitDataRequest_ChunksToMove::InternalSwap(CommitDataRequest_ChunksToMove* other) {
395 using std::swap;
396 auto* lhs_arena = GetArenaForAllocation();
397 auto* rhs_arena = other->GetArenaForAllocation();
398 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
399 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
400 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
401 &_impl_.data_, lhs_arena,
402 &other->_impl_.data_, rhs_arena
403 );
404 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
405 PROTOBUF_FIELD_OFFSET(CommitDataRequest_ChunksToMove, _impl_.target_buffer_)
406 + sizeof(CommitDataRequest_ChunksToMove::_impl_.target_buffer_) // NOLINT
407 - PROTOBUF_FIELD_OFFSET(CommitDataRequest_ChunksToMove, _impl_.page_)>(
408 reinterpret_cast<char*>(&_impl_.page_),
409 reinterpret_cast<char*>(&other->_impl_.page_));
410 }
411
GetTypeName() const412 std::string CommitDataRequest_ChunksToMove::GetTypeName() const {
413 return "perfetto.protos.CommitDataRequest.ChunksToMove";
414 }
415
416
417 // ===================================================================
418
419 class CommitDataRequest_ChunkToPatch_Patch::_Internal {
420 public:
421 using HasBits = decltype(std::declval<CommitDataRequest_ChunkToPatch_Patch>()._impl_._has_bits_);
set_has_offset(HasBits * has_bits)422 static void set_has_offset(HasBits* has_bits) {
423 (*has_bits)[0] |= 2u;
424 }
set_has_data(HasBits * has_bits)425 static void set_has_data(HasBits* has_bits) {
426 (*has_bits)[0] |= 1u;
427 }
428 };
429
CommitDataRequest_ChunkToPatch_Patch(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)430 CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch(::PROTOBUF_NAMESPACE_ID::Arena* arena,
431 bool is_message_owned)
432 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
433 SharedCtor(arena, is_message_owned);
434 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
435 }
CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch & from)436 CommitDataRequest_ChunkToPatch_Patch::CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch& from)
437 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
438 CommitDataRequest_ChunkToPatch_Patch* const _this = this; (void)_this;
439 new (&_impl_) Impl_{
440 decltype(_impl_._has_bits_){from._impl_._has_bits_}
441 , /*decltype(_impl_._cached_size_)*/{}
442 , decltype(_impl_.data_){}
443 , decltype(_impl_.offset_){}};
444
445 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
446 _impl_.data_.InitDefault();
447 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
448 _impl_.data_.Set("", GetArenaForAllocation());
449 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
450 if (from._internal_has_data()) {
451 _this->_impl_.data_.Set(from._internal_data(),
452 _this->GetArenaForAllocation());
453 }
454 _this->_impl_.offset_ = from._impl_.offset_;
455 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
456 }
457
SharedCtor(::_pb::Arena * arena,bool is_message_owned)458 inline void CommitDataRequest_ChunkToPatch_Patch::SharedCtor(
459 ::_pb::Arena* arena, bool is_message_owned) {
460 (void)arena;
461 (void)is_message_owned;
462 new (&_impl_) Impl_{
463 decltype(_impl_._has_bits_){}
464 , /*decltype(_impl_._cached_size_)*/{}
465 , decltype(_impl_.data_){}
466 , decltype(_impl_.offset_){0u}
467 };
468 _impl_.data_.InitDefault();
469 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
470 _impl_.data_.Set("", GetArenaForAllocation());
471 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
472 }
473
~CommitDataRequest_ChunkToPatch_Patch()474 CommitDataRequest_ChunkToPatch_Patch::~CommitDataRequest_ChunkToPatch_Patch() {
475 // @@protoc_insertion_point(destructor:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
476 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
477 (void)arena;
478 return;
479 }
480 SharedDtor();
481 }
482
SharedDtor()483 inline void CommitDataRequest_ChunkToPatch_Patch::SharedDtor() {
484 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
485 _impl_.data_.Destroy();
486 }
487
SetCachedSize(int size) const488 void CommitDataRequest_ChunkToPatch_Patch::SetCachedSize(int size) const {
489 _impl_._cached_size_.Set(size);
490 }
491
Clear()492 void CommitDataRequest_ChunkToPatch_Patch::Clear() {
493 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
494 ::uint32_t cached_has_bits = 0;
495 // Prevent compiler warnings about cached_has_bits being unused
496 (void) cached_has_bits;
497
498 cached_has_bits = _impl_._has_bits_[0];
499 if (cached_has_bits & 0x00000001u) {
500 _impl_.data_.ClearNonDefaultToEmpty();
501 }
502 _impl_.offset_ = 0u;
503 _impl_._has_bits_.Clear();
504 _internal_metadata_.Clear<std::string>();
505 }
506
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)507 const char* CommitDataRequest_ChunkToPatch_Patch::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
508 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
509 _Internal::HasBits has_bits{};
510 while (!ctx->Done(&ptr)) {
511 ::uint32_t tag;
512 ptr = ::_pbi::ReadTag(ptr, &tag);
513 switch (tag >> 3) {
514 // optional uint32 offset = 1;
515 case 1:
516 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
517 _Internal::set_has_offset(&has_bits);
518 _impl_.offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
519 CHK_(ptr);
520 } else {
521 goto handle_unusual;
522 }
523 continue;
524 // optional bytes data = 2;
525 case 2:
526 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
527 auto str = _internal_mutable_data();
528 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
529 CHK_(ptr);
530 } else {
531 goto handle_unusual;
532 }
533 continue;
534 default:
535 goto handle_unusual;
536 } // switch
537 handle_unusual:
538 if ((tag == 0) || ((tag & 7) == 4)) {
539 CHK_(ptr);
540 ctx->SetLastTag(tag);
541 goto message_done;
542 }
543 ptr = UnknownFieldParse(
544 tag,
545 _internal_metadata_.mutable_unknown_fields<std::string>(),
546 ptr, ctx);
547 CHK_(ptr != nullptr);
548 } // while
549 message_done:
550 _impl_._has_bits_.Or(has_bits);
551 return ptr;
552 failure:
553 ptr = nullptr;
554 goto message_done;
555 #undef CHK_
556 }
557
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const558 ::uint8_t* CommitDataRequest_ChunkToPatch_Patch::_InternalSerialize(
559 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
560 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
561 ::uint32_t cached_has_bits = 0;
562 (void) cached_has_bits;
563
564 cached_has_bits = _impl_._has_bits_[0];
565 // optional uint32 offset = 1;
566 if (cached_has_bits & 0x00000002u) {
567 target = stream->EnsureSpace(target);
568 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_offset(), target);
569 }
570
571 // optional bytes data = 2;
572 if (cached_has_bits & 0x00000001u) {
573 target = stream->WriteBytesMaybeAliased(
574 2, this->_internal_data(), target);
575 }
576
577 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
578 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
579 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
580 }
581 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
582 return target;
583 }
584
ByteSizeLong() const585 size_t CommitDataRequest_ChunkToPatch_Patch::ByteSizeLong() const {
586 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
587 size_t total_size = 0;
588
589 ::uint32_t cached_has_bits = 0;
590 // Prevent compiler warnings about cached_has_bits being unused
591 (void) cached_has_bits;
592
593 cached_has_bits = _impl_._has_bits_[0];
594 if (cached_has_bits & 0x00000003u) {
595 // optional bytes data = 2;
596 if (cached_has_bits & 0x00000001u) {
597 total_size += 1 +
598 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
599 this->_internal_data());
600 }
601
602 // optional uint32 offset = 1;
603 if (cached_has_bits & 0x00000002u) {
604 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_offset());
605 }
606
607 }
608 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
609 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
610 }
611 int cached_size = ::_pbi::ToCachedSize(total_size);
612 SetCachedSize(cached_size);
613 return total_size;
614 }
615
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)616 void CommitDataRequest_ChunkToPatch_Patch::CheckTypeAndMergeFrom(
617 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
618 MergeFrom(*::_pbi::DownCast<const CommitDataRequest_ChunkToPatch_Patch*>(
619 &from));
620 }
621
MergeFrom(const CommitDataRequest_ChunkToPatch_Patch & from)622 void CommitDataRequest_ChunkToPatch_Patch::MergeFrom(const CommitDataRequest_ChunkToPatch_Patch& from) {
623 CommitDataRequest_ChunkToPatch_Patch* const _this = this;
624 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
625 GOOGLE_DCHECK_NE(&from, _this);
626 ::uint32_t cached_has_bits = 0;
627 (void) cached_has_bits;
628
629 cached_has_bits = from._impl_._has_bits_[0];
630 if (cached_has_bits & 0x00000003u) {
631 if (cached_has_bits & 0x00000001u) {
632 _this->_internal_set_data(from._internal_data());
633 }
634 if (cached_has_bits & 0x00000002u) {
635 _this->_impl_.offset_ = from._impl_.offset_;
636 }
637 _this->_impl_._has_bits_[0] |= cached_has_bits;
638 }
639 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
640 }
641
CopyFrom(const CommitDataRequest_ChunkToPatch_Patch & from)642 void CommitDataRequest_ChunkToPatch_Patch::CopyFrom(const CommitDataRequest_ChunkToPatch_Patch& from) {
643 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CommitDataRequest.ChunkToPatch.Patch)
644 if (&from == this) return;
645 Clear();
646 MergeFrom(from);
647 }
648
IsInitialized() const649 bool CommitDataRequest_ChunkToPatch_Patch::IsInitialized() const {
650 return true;
651 }
652
InternalSwap(CommitDataRequest_ChunkToPatch_Patch * other)653 void CommitDataRequest_ChunkToPatch_Patch::InternalSwap(CommitDataRequest_ChunkToPatch_Patch* other) {
654 using std::swap;
655 auto* lhs_arena = GetArenaForAllocation();
656 auto* rhs_arena = other->GetArenaForAllocation();
657 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
658 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
659 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
660 &_impl_.data_, lhs_arena,
661 &other->_impl_.data_, rhs_arena
662 );
663 swap(_impl_.offset_, other->_impl_.offset_);
664 }
665
GetTypeName() const666 std::string CommitDataRequest_ChunkToPatch_Patch::GetTypeName() const {
667 return "perfetto.protos.CommitDataRequest.ChunkToPatch.Patch";
668 }
669
670
671 // ===================================================================
672
673 class CommitDataRequest_ChunkToPatch::_Internal {
674 public:
675 using HasBits = decltype(std::declval<CommitDataRequest_ChunkToPatch>()._impl_._has_bits_);
set_has_target_buffer(HasBits * has_bits)676 static void set_has_target_buffer(HasBits* has_bits) {
677 (*has_bits)[0] |= 1u;
678 }
set_has_writer_id(HasBits * has_bits)679 static void set_has_writer_id(HasBits* has_bits) {
680 (*has_bits)[0] |= 2u;
681 }
set_has_chunk_id(HasBits * has_bits)682 static void set_has_chunk_id(HasBits* has_bits) {
683 (*has_bits)[0] |= 4u;
684 }
set_has_has_more_patches(HasBits * has_bits)685 static void set_has_has_more_patches(HasBits* has_bits) {
686 (*has_bits)[0] |= 8u;
687 }
688 };
689
CommitDataRequest_ChunkToPatch(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)690 CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch(::PROTOBUF_NAMESPACE_ID::Arena* arena,
691 bool is_message_owned)
692 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
693 SharedCtor(arena, is_message_owned);
694 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CommitDataRequest.ChunkToPatch)
695 }
CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch & from)696 CommitDataRequest_ChunkToPatch::CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch& from)
697 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
698 CommitDataRequest_ChunkToPatch* const _this = this; (void)_this;
699 new (&_impl_) Impl_{
700 decltype(_impl_._has_bits_){from._impl_._has_bits_}
701 , /*decltype(_impl_._cached_size_)*/{}
702 , decltype(_impl_.patches_){from._impl_.patches_}
703 , decltype(_impl_.target_buffer_){}
704 , decltype(_impl_.writer_id_){}
705 , decltype(_impl_.chunk_id_){}
706 , decltype(_impl_.has_more_patches_){}};
707
708 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
709 ::memcpy(&_impl_.target_buffer_, &from._impl_.target_buffer_,
710 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.has_more_patches_) -
711 reinterpret_cast<char*>(&_impl_.target_buffer_)) + sizeof(_impl_.has_more_patches_));
712 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CommitDataRequest.ChunkToPatch)
713 }
714
SharedCtor(::_pb::Arena * arena,bool is_message_owned)715 inline void CommitDataRequest_ChunkToPatch::SharedCtor(
716 ::_pb::Arena* arena, bool is_message_owned) {
717 (void)arena;
718 (void)is_message_owned;
719 new (&_impl_) Impl_{
720 decltype(_impl_._has_bits_){}
721 , /*decltype(_impl_._cached_size_)*/{}
722 , decltype(_impl_.patches_){arena}
723 , decltype(_impl_.target_buffer_){0u}
724 , decltype(_impl_.writer_id_){0u}
725 , decltype(_impl_.chunk_id_){0u}
726 , decltype(_impl_.has_more_patches_){false}
727 };
728 }
729
~CommitDataRequest_ChunkToPatch()730 CommitDataRequest_ChunkToPatch::~CommitDataRequest_ChunkToPatch() {
731 // @@protoc_insertion_point(destructor:perfetto.protos.CommitDataRequest.ChunkToPatch)
732 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
733 (void)arena;
734 return;
735 }
736 SharedDtor();
737 }
738
SharedDtor()739 inline void CommitDataRequest_ChunkToPatch::SharedDtor() {
740 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
741 _impl_.patches_.~RepeatedPtrField();
742 }
743
SetCachedSize(int size) const744 void CommitDataRequest_ChunkToPatch::SetCachedSize(int size) const {
745 _impl_._cached_size_.Set(size);
746 }
747
Clear()748 void CommitDataRequest_ChunkToPatch::Clear() {
749 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CommitDataRequest.ChunkToPatch)
750 ::uint32_t cached_has_bits = 0;
751 // Prevent compiler warnings about cached_has_bits being unused
752 (void) cached_has_bits;
753
754 _impl_.patches_.Clear();
755 cached_has_bits = _impl_._has_bits_[0];
756 if (cached_has_bits & 0x0000000fu) {
757 ::memset(&_impl_.target_buffer_, 0, static_cast<size_t>(
758 reinterpret_cast<char*>(&_impl_.has_more_patches_) -
759 reinterpret_cast<char*>(&_impl_.target_buffer_)) + sizeof(_impl_.has_more_patches_));
760 }
761 _impl_._has_bits_.Clear();
762 _internal_metadata_.Clear<std::string>();
763 }
764
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)765 const char* CommitDataRequest_ChunkToPatch::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
766 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
767 _Internal::HasBits has_bits{};
768 while (!ctx->Done(&ptr)) {
769 ::uint32_t tag;
770 ptr = ::_pbi::ReadTag(ptr, &tag);
771 switch (tag >> 3) {
772 // optional uint32 target_buffer = 1;
773 case 1:
774 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
775 _Internal::set_has_target_buffer(&has_bits);
776 _impl_.target_buffer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
777 CHK_(ptr);
778 } else {
779 goto handle_unusual;
780 }
781 continue;
782 // optional uint32 writer_id = 2;
783 case 2:
784 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
785 _Internal::set_has_writer_id(&has_bits);
786 _impl_.writer_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
787 CHK_(ptr);
788 } else {
789 goto handle_unusual;
790 }
791 continue;
792 // optional uint32 chunk_id = 3;
793 case 3:
794 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
795 _Internal::set_has_chunk_id(&has_bits);
796 _impl_.chunk_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
797 CHK_(ptr);
798 } else {
799 goto handle_unusual;
800 }
801 continue;
802 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch.Patch patches = 4;
803 case 4:
804 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
805 ptr -= 1;
806 do {
807 ptr += 1;
808 ptr = ctx->ParseMessage(_internal_add_patches(), ptr);
809 CHK_(ptr);
810 if (!ctx->DataAvailable(ptr)) break;
811 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
812 } else {
813 goto handle_unusual;
814 }
815 continue;
816 // optional bool has_more_patches = 5;
817 case 5:
818 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
819 _Internal::set_has_has_more_patches(&has_bits);
820 _impl_.has_more_patches_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
821 CHK_(ptr);
822 } else {
823 goto handle_unusual;
824 }
825 continue;
826 default:
827 goto handle_unusual;
828 } // switch
829 handle_unusual:
830 if ((tag == 0) || ((tag & 7) == 4)) {
831 CHK_(ptr);
832 ctx->SetLastTag(tag);
833 goto message_done;
834 }
835 ptr = UnknownFieldParse(
836 tag,
837 _internal_metadata_.mutable_unknown_fields<std::string>(),
838 ptr, ctx);
839 CHK_(ptr != nullptr);
840 } // while
841 message_done:
842 _impl_._has_bits_.Or(has_bits);
843 return ptr;
844 failure:
845 ptr = nullptr;
846 goto message_done;
847 #undef CHK_
848 }
849
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const850 ::uint8_t* CommitDataRequest_ChunkToPatch::_InternalSerialize(
851 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
852 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CommitDataRequest.ChunkToPatch)
853 ::uint32_t cached_has_bits = 0;
854 (void) cached_has_bits;
855
856 cached_has_bits = _impl_._has_bits_[0];
857 // optional uint32 target_buffer = 1;
858 if (cached_has_bits & 0x00000001u) {
859 target = stream->EnsureSpace(target);
860 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_target_buffer(), target);
861 }
862
863 // optional uint32 writer_id = 2;
864 if (cached_has_bits & 0x00000002u) {
865 target = stream->EnsureSpace(target);
866 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_writer_id(), target);
867 }
868
869 // optional uint32 chunk_id = 3;
870 if (cached_has_bits & 0x00000004u) {
871 target = stream->EnsureSpace(target);
872 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_chunk_id(), target);
873 }
874
875 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch.Patch patches = 4;
876 for (unsigned i = 0,
877 n = static_cast<unsigned>(this->_internal_patches_size()); i < n; i++) {
878 const auto& repfield = this->_internal_patches(i);
879 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
880 InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
881 }
882
883 // optional bool has_more_patches = 5;
884 if (cached_has_bits & 0x00000008u) {
885 target = stream->EnsureSpace(target);
886 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_has_more_patches(), target);
887 }
888
889 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
890 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
891 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
892 }
893 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CommitDataRequest.ChunkToPatch)
894 return target;
895 }
896
ByteSizeLong() const897 size_t CommitDataRequest_ChunkToPatch::ByteSizeLong() const {
898 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CommitDataRequest.ChunkToPatch)
899 size_t total_size = 0;
900
901 ::uint32_t cached_has_bits = 0;
902 // Prevent compiler warnings about cached_has_bits being unused
903 (void) cached_has_bits;
904
905 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch.Patch patches = 4;
906 total_size += 1UL * this->_internal_patches_size();
907 for (const auto& msg : this->_impl_.patches_) {
908 total_size +=
909 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
910 }
911
912 cached_has_bits = _impl_._has_bits_[0];
913 if (cached_has_bits & 0x0000000fu) {
914 // optional uint32 target_buffer = 1;
915 if (cached_has_bits & 0x00000001u) {
916 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_target_buffer());
917 }
918
919 // optional uint32 writer_id = 2;
920 if (cached_has_bits & 0x00000002u) {
921 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_writer_id());
922 }
923
924 // optional uint32 chunk_id = 3;
925 if (cached_has_bits & 0x00000004u) {
926 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_chunk_id());
927 }
928
929 // optional bool has_more_patches = 5;
930 if (cached_has_bits & 0x00000008u) {
931 total_size += 1 + 1;
932 }
933
934 }
935 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
936 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
937 }
938 int cached_size = ::_pbi::ToCachedSize(total_size);
939 SetCachedSize(cached_size);
940 return total_size;
941 }
942
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)943 void CommitDataRequest_ChunkToPatch::CheckTypeAndMergeFrom(
944 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
945 MergeFrom(*::_pbi::DownCast<const CommitDataRequest_ChunkToPatch*>(
946 &from));
947 }
948
MergeFrom(const CommitDataRequest_ChunkToPatch & from)949 void CommitDataRequest_ChunkToPatch::MergeFrom(const CommitDataRequest_ChunkToPatch& from) {
950 CommitDataRequest_ChunkToPatch* const _this = this;
951 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CommitDataRequest.ChunkToPatch)
952 GOOGLE_DCHECK_NE(&from, _this);
953 ::uint32_t cached_has_bits = 0;
954 (void) cached_has_bits;
955
956 _this->_impl_.patches_.MergeFrom(from._impl_.patches_);
957 cached_has_bits = from._impl_._has_bits_[0];
958 if (cached_has_bits & 0x0000000fu) {
959 if (cached_has_bits & 0x00000001u) {
960 _this->_impl_.target_buffer_ = from._impl_.target_buffer_;
961 }
962 if (cached_has_bits & 0x00000002u) {
963 _this->_impl_.writer_id_ = from._impl_.writer_id_;
964 }
965 if (cached_has_bits & 0x00000004u) {
966 _this->_impl_.chunk_id_ = from._impl_.chunk_id_;
967 }
968 if (cached_has_bits & 0x00000008u) {
969 _this->_impl_.has_more_patches_ = from._impl_.has_more_patches_;
970 }
971 _this->_impl_._has_bits_[0] |= cached_has_bits;
972 }
973 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
974 }
975
CopyFrom(const CommitDataRequest_ChunkToPatch & from)976 void CommitDataRequest_ChunkToPatch::CopyFrom(const CommitDataRequest_ChunkToPatch& from) {
977 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CommitDataRequest.ChunkToPatch)
978 if (&from == this) return;
979 Clear();
980 MergeFrom(from);
981 }
982
IsInitialized() const983 bool CommitDataRequest_ChunkToPatch::IsInitialized() const {
984 return true;
985 }
986
InternalSwap(CommitDataRequest_ChunkToPatch * other)987 void CommitDataRequest_ChunkToPatch::InternalSwap(CommitDataRequest_ChunkToPatch* other) {
988 using std::swap;
989 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
990 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
991 _impl_.patches_.InternalSwap(&other->_impl_.patches_);
992 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
993 PROTOBUF_FIELD_OFFSET(CommitDataRequest_ChunkToPatch, _impl_.has_more_patches_)
994 + sizeof(CommitDataRequest_ChunkToPatch::_impl_.has_more_patches_) // NOLINT
995 - PROTOBUF_FIELD_OFFSET(CommitDataRequest_ChunkToPatch, _impl_.target_buffer_)>(
996 reinterpret_cast<char*>(&_impl_.target_buffer_),
997 reinterpret_cast<char*>(&other->_impl_.target_buffer_));
998 }
999
GetTypeName() const1000 std::string CommitDataRequest_ChunkToPatch::GetTypeName() const {
1001 return "perfetto.protos.CommitDataRequest.ChunkToPatch";
1002 }
1003
1004
1005 // ===================================================================
1006
1007 class CommitDataRequest::_Internal {
1008 public:
1009 using HasBits = decltype(std::declval<CommitDataRequest>()._impl_._has_bits_);
set_has_flush_request_id(HasBits * has_bits)1010 static void set_has_flush_request_id(HasBits* has_bits) {
1011 (*has_bits)[0] |= 1u;
1012 }
1013 };
1014
CommitDataRequest(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1015 CommitDataRequest::CommitDataRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1016 bool is_message_owned)
1017 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1018 SharedCtor(arena, is_message_owned);
1019 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CommitDataRequest)
1020 }
CommitDataRequest(const CommitDataRequest & from)1021 CommitDataRequest::CommitDataRequest(const CommitDataRequest& from)
1022 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1023 CommitDataRequest* const _this = this; (void)_this;
1024 new (&_impl_) Impl_{
1025 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1026 , /*decltype(_impl_._cached_size_)*/{}
1027 , decltype(_impl_.chunks_to_move_){from._impl_.chunks_to_move_}
1028 , decltype(_impl_.chunks_to_patch_){from._impl_.chunks_to_patch_}
1029 , decltype(_impl_.flush_request_id_){}};
1030
1031 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1032 _this->_impl_.flush_request_id_ = from._impl_.flush_request_id_;
1033 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CommitDataRequest)
1034 }
1035
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1036 inline void CommitDataRequest::SharedCtor(
1037 ::_pb::Arena* arena, bool is_message_owned) {
1038 (void)arena;
1039 (void)is_message_owned;
1040 new (&_impl_) Impl_{
1041 decltype(_impl_._has_bits_){}
1042 , /*decltype(_impl_._cached_size_)*/{}
1043 , decltype(_impl_.chunks_to_move_){arena}
1044 , decltype(_impl_.chunks_to_patch_){arena}
1045 , decltype(_impl_.flush_request_id_){::uint64_t{0u}}
1046 };
1047 }
1048
~CommitDataRequest()1049 CommitDataRequest::~CommitDataRequest() {
1050 // @@protoc_insertion_point(destructor:perfetto.protos.CommitDataRequest)
1051 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1052 (void)arena;
1053 return;
1054 }
1055 SharedDtor();
1056 }
1057
SharedDtor()1058 inline void CommitDataRequest::SharedDtor() {
1059 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1060 _impl_.chunks_to_move_.~RepeatedPtrField();
1061 _impl_.chunks_to_patch_.~RepeatedPtrField();
1062 }
1063
SetCachedSize(int size) const1064 void CommitDataRequest::SetCachedSize(int size) const {
1065 _impl_._cached_size_.Set(size);
1066 }
1067
Clear()1068 void CommitDataRequest::Clear() {
1069 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CommitDataRequest)
1070 ::uint32_t cached_has_bits = 0;
1071 // Prevent compiler warnings about cached_has_bits being unused
1072 (void) cached_has_bits;
1073
1074 _impl_.chunks_to_move_.Clear();
1075 _impl_.chunks_to_patch_.Clear();
1076 _impl_.flush_request_id_ = ::uint64_t{0u};
1077 _impl_._has_bits_.Clear();
1078 _internal_metadata_.Clear<std::string>();
1079 }
1080
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1081 const char* CommitDataRequest::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1082 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1083 _Internal::HasBits has_bits{};
1084 while (!ctx->Done(&ptr)) {
1085 ::uint32_t tag;
1086 ptr = ::_pbi::ReadTag(ptr, &tag);
1087 switch (tag >> 3) {
1088 // repeated .perfetto.protos.CommitDataRequest.ChunksToMove chunks_to_move = 1;
1089 case 1:
1090 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1091 ptr -= 1;
1092 do {
1093 ptr += 1;
1094 ptr = ctx->ParseMessage(_internal_add_chunks_to_move(), ptr);
1095 CHK_(ptr);
1096 if (!ctx->DataAvailable(ptr)) break;
1097 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
1098 } else {
1099 goto handle_unusual;
1100 }
1101 continue;
1102 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch chunks_to_patch = 2;
1103 case 2:
1104 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1105 ptr -= 1;
1106 do {
1107 ptr += 1;
1108 ptr = ctx->ParseMessage(_internal_add_chunks_to_patch(), ptr);
1109 CHK_(ptr);
1110 if (!ctx->DataAvailable(ptr)) break;
1111 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
1112 } else {
1113 goto handle_unusual;
1114 }
1115 continue;
1116 // optional uint64 flush_request_id = 3;
1117 case 3:
1118 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1119 _Internal::set_has_flush_request_id(&has_bits);
1120 _impl_.flush_request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1121 CHK_(ptr);
1122 } else {
1123 goto handle_unusual;
1124 }
1125 continue;
1126 default:
1127 goto handle_unusual;
1128 } // switch
1129 handle_unusual:
1130 if ((tag == 0) || ((tag & 7) == 4)) {
1131 CHK_(ptr);
1132 ctx->SetLastTag(tag);
1133 goto message_done;
1134 }
1135 ptr = UnknownFieldParse(
1136 tag,
1137 _internal_metadata_.mutable_unknown_fields<std::string>(),
1138 ptr, ctx);
1139 CHK_(ptr != nullptr);
1140 } // while
1141 message_done:
1142 _impl_._has_bits_.Or(has_bits);
1143 return ptr;
1144 failure:
1145 ptr = nullptr;
1146 goto message_done;
1147 #undef CHK_
1148 }
1149
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1150 ::uint8_t* CommitDataRequest::_InternalSerialize(
1151 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1152 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CommitDataRequest)
1153 ::uint32_t cached_has_bits = 0;
1154 (void) cached_has_bits;
1155
1156 // repeated .perfetto.protos.CommitDataRequest.ChunksToMove chunks_to_move = 1;
1157 for (unsigned i = 0,
1158 n = static_cast<unsigned>(this->_internal_chunks_to_move_size()); i < n; i++) {
1159 const auto& repfield = this->_internal_chunks_to_move(i);
1160 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1161 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
1162 }
1163
1164 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch chunks_to_patch = 2;
1165 for (unsigned i = 0,
1166 n = static_cast<unsigned>(this->_internal_chunks_to_patch_size()); i < n; i++) {
1167 const auto& repfield = this->_internal_chunks_to_patch(i);
1168 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1169 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
1170 }
1171
1172 cached_has_bits = _impl_._has_bits_[0];
1173 // optional uint64 flush_request_id = 3;
1174 if (cached_has_bits & 0x00000001u) {
1175 target = stream->EnsureSpace(target);
1176 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_flush_request_id(), target);
1177 }
1178
1179 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1180 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1181 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1182 }
1183 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CommitDataRequest)
1184 return target;
1185 }
1186
ByteSizeLong() const1187 size_t CommitDataRequest::ByteSizeLong() const {
1188 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CommitDataRequest)
1189 size_t total_size = 0;
1190
1191 ::uint32_t cached_has_bits = 0;
1192 // Prevent compiler warnings about cached_has_bits being unused
1193 (void) cached_has_bits;
1194
1195 // repeated .perfetto.protos.CommitDataRequest.ChunksToMove chunks_to_move = 1;
1196 total_size += 1UL * this->_internal_chunks_to_move_size();
1197 for (const auto& msg : this->_impl_.chunks_to_move_) {
1198 total_size +=
1199 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1200 }
1201
1202 // repeated .perfetto.protos.CommitDataRequest.ChunkToPatch chunks_to_patch = 2;
1203 total_size += 1UL * this->_internal_chunks_to_patch_size();
1204 for (const auto& msg : this->_impl_.chunks_to_patch_) {
1205 total_size +=
1206 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1207 }
1208
1209 // optional uint64 flush_request_id = 3;
1210 cached_has_bits = _impl_._has_bits_[0];
1211 if (cached_has_bits & 0x00000001u) {
1212 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_flush_request_id());
1213 }
1214
1215 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1216 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1217 }
1218 int cached_size = ::_pbi::ToCachedSize(total_size);
1219 SetCachedSize(cached_size);
1220 return total_size;
1221 }
1222
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1223 void CommitDataRequest::CheckTypeAndMergeFrom(
1224 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1225 MergeFrom(*::_pbi::DownCast<const CommitDataRequest*>(
1226 &from));
1227 }
1228
MergeFrom(const CommitDataRequest & from)1229 void CommitDataRequest::MergeFrom(const CommitDataRequest& from) {
1230 CommitDataRequest* const _this = this;
1231 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CommitDataRequest)
1232 GOOGLE_DCHECK_NE(&from, _this);
1233 ::uint32_t cached_has_bits = 0;
1234 (void) cached_has_bits;
1235
1236 _this->_impl_.chunks_to_move_.MergeFrom(from._impl_.chunks_to_move_);
1237 _this->_impl_.chunks_to_patch_.MergeFrom(from._impl_.chunks_to_patch_);
1238 if (from._internal_has_flush_request_id()) {
1239 _this->_internal_set_flush_request_id(from._internal_flush_request_id());
1240 }
1241 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1242 }
1243
CopyFrom(const CommitDataRequest & from)1244 void CommitDataRequest::CopyFrom(const CommitDataRequest& from) {
1245 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CommitDataRequest)
1246 if (&from == this) return;
1247 Clear();
1248 MergeFrom(from);
1249 }
1250
IsInitialized() const1251 bool CommitDataRequest::IsInitialized() const {
1252 return true;
1253 }
1254
InternalSwap(CommitDataRequest * other)1255 void CommitDataRequest::InternalSwap(CommitDataRequest* other) {
1256 using std::swap;
1257 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1258 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1259 _impl_.chunks_to_move_.InternalSwap(&other->_impl_.chunks_to_move_);
1260 _impl_.chunks_to_patch_.InternalSwap(&other->_impl_.chunks_to_patch_);
1261 swap(_impl_.flush_request_id_, other->_impl_.flush_request_id_);
1262 }
1263
GetTypeName() const1264 std::string CommitDataRequest::GetTypeName() const {
1265 return "perfetto.protos.CommitDataRequest";
1266 }
1267
1268
1269 // @@protoc_insertion_point(namespace_scope)
1270 } // namespace protos
1271 } // namespace perfetto
1272 PROTOBUF_NAMESPACE_OPEN
1273 template<> PROTOBUF_NOINLINE ::perfetto::protos::CommitDataRequest_ChunksToMove*
CreateMaybeMessage(Arena * arena)1274 Arena::CreateMaybeMessage< ::perfetto::protos::CommitDataRequest_ChunksToMove >(Arena* arena) {
1275 return Arena::CreateMessageInternal< ::perfetto::protos::CommitDataRequest_ChunksToMove >(arena);
1276 }
1277 template<> PROTOBUF_NOINLINE ::perfetto::protos::CommitDataRequest_ChunkToPatch_Patch*
CreateMaybeMessage(Arena * arena)1278 Arena::CreateMaybeMessage< ::perfetto::protos::CommitDataRequest_ChunkToPatch_Patch >(Arena* arena) {
1279 return Arena::CreateMessageInternal< ::perfetto::protos::CommitDataRequest_ChunkToPatch_Patch >(arena);
1280 }
1281 template<> PROTOBUF_NOINLINE ::perfetto::protos::CommitDataRequest_ChunkToPatch*
CreateMaybeMessage(Arena * arena)1282 Arena::CreateMaybeMessage< ::perfetto::protos::CommitDataRequest_ChunkToPatch >(Arena* arena) {
1283 return Arena::CreateMessageInternal< ::perfetto::protos::CommitDataRequest_ChunkToPatch >(arena);
1284 }
1285 template<> PROTOBUF_NOINLINE ::perfetto::protos::CommitDataRequest*
CreateMaybeMessage(Arena * arena)1286 Arena::CreateMaybeMessage< ::perfetto::protos::CommitDataRequest >(Arena* arena) {
1287 return Arena::CreateMessageInternal< ::perfetto::protos::CommitDataRequest >(arena);
1288 }
1289 PROTOBUF_NAMESPACE_CLOSE
1290
1291 // @@protoc_insertion_point(global_scope)
1292 #include <google/protobuf/port_undef.inc>
1293