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