1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/chrome_histogram_sample.proto
3
4 #include "protos/perfetto/trace/track_event/chrome_histogram_sample.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 {
HistogramName(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR HistogramName::HistogramName(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.iid_)*/::uint64_t{0u}} {}
29 struct HistogramNameDefaultTypeInternal {
HistogramNameDefaultTypeInternalperfetto::protos::HistogramNameDefaultTypeInternal30 PROTOBUF_CONSTEXPR HistogramNameDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~HistogramNameDefaultTypeInternalperfetto::protos::HistogramNameDefaultTypeInternal32 ~HistogramNameDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 HistogramName _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HistogramNameDefaultTypeInternal _HistogramName_default_instance_;
ChromeHistogramSample(::_pbi::ConstantInitialized)38 PROTOBUF_CONSTEXPR ChromeHistogramSample::ChromeHistogramSample(
39 ::_pbi::ConstantInitialized): _impl_{
40 /*decltype(_impl_._has_bits_)*/{}
41 , /*decltype(_impl_._cached_size_)*/{}
42 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
43 , /*decltype(_impl_.name_hash_)*/::uint64_t{0u}
44 , /*decltype(_impl_.sample_)*/::int64_t{0}
45 , /*decltype(_impl_.name_iid_)*/::uint64_t{0u}} {}
46 struct ChromeHistogramSampleDefaultTypeInternal {
ChromeHistogramSampleDefaultTypeInternalperfetto::protos::ChromeHistogramSampleDefaultTypeInternal47 PROTOBUF_CONSTEXPR ChromeHistogramSampleDefaultTypeInternal()
48 : _instance(::_pbi::ConstantInitialized{}) {}
~ChromeHistogramSampleDefaultTypeInternalperfetto::protos::ChromeHistogramSampleDefaultTypeInternal49 ~ChromeHistogramSampleDefaultTypeInternal() {}
50 union { // NOLINT(misc-non-private-member-variables-in-classes)
51 ChromeHistogramSample _instance;
52 };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChromeHistogramSampleDefaultTypeInternal _ChromeHistogramSample_default_instance_;
55 } // namespace protos
56 } // namespace perfetto
57 namespace perfetto {
58 namespace protos {
59
60 // ===================================================================
61
62 class HistogramName::_Internal {
63 public:
64 using HasBits = decltype(std::declval<HistogramName>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)65 static void set_has_iid(HasBits* has_bits) {
66 (*has_bits)[0] |= 2u;
67 }
set_has_name(HasBits * has_bits)68 static void set_has_name(HasBits* has_bits) {
69 (*has_bits)[0] |= 1u;
70 }
71 };
72
HistogramName(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)73 HistogramName::HistogramName(::PROTOBUF_NAMESPACE_ID::Arena* arena,
74 bool is_message_owned)
75 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
76 SharedCtor(arena, is_message_owned);
77 // @@protoc_insertion_point(arena_constructor:perfetto.protos.HistogramName)
78 }
HistogramName(const HistogramName & from)79 HistogramName::HistogramName(const HistogramName& from)
80 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
81 HistogramName* const _this = this; (void)_this;
82 new (&_impl_) Impl_{
83 decltype(_impl_._has_bits_){from._impl_._has_bits_}
84 , /*decltype(_impl_._cached_size_)*/{}
85 , decltype(_impl_.name_){}
86 , decltype(_impl_.iid_){}};
87
88 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
89 _impl_.name_.InitDefault();
90 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
91 _impl_.name_.Set("", GetArenaForAllocation());
92 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
93 if (from._internal_has_name()) {
94 _this->_impl_.name_.Set(from._internal_name(),
95 _this->GetArenaForAllocation());
96 }
97 _this->_impl_.iid_ = from._impl_.iid_;
98 // @@protoc_insertion_point(copy_constructor:perfetto.protos.HistogramName)
99 }
100
SharedCtor(::_pb::Arena * arena,bool is_message_owned)101 inline void HistogramName::SharedCtor(
102 ::_pb::Arena* arena, bool is_message_owned) {
103 (void)arena;
104 (void)is_message_owned;
105 new (&_impl_) Impl_{
106 decltype(_impl_._has_bits_){}
107 , /*decltype(_impl_._cached_size_)*/{}
108 , decltype(_impl_.name_){}
109 , decltype(_impl_.iid_){::uint64_t{0u}}
110 };
111 _impl_.name_.InitDefault();
112 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
113 _impl_.name_.Set("", GetArenaForAllocation());
114 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
115 }
116
~HistogramName()117 HistogramName::~HistogramName() {
118 // @@protoc_insertion_point(destructor:perfetto.protos.HistogramName)
119 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
120 (void)arena;
121 return;
122 }
123 SharedDtor();
124 }
125
SharedDtor()126 inline void HistogramName::SharedDtor() {
127 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
128 _impl_.name_.Destroy();
129 }
130
SetCachedSize(int size) const131 void HistogramName::SetCachedSize(int size) const {
132 _impl_._cached_size_.Set(size);
133 }
134
Clear()135 void HistogramName::Clear() {
136 // @@protoc_insertion_point(message_clear_start:perfetto.protos.HistogramName)
137 ::uint32_t cached_has_bits = 0;
138 // Prevent compiler warnings about cached_has_bits being unused
139 (void) cached_has_bits;
140
141 cached_has_bits = _impl_._has_bits_[0];
142 if (cached_has_bits & 0x00000001u) {
143 _impl_.name_.ClearNonDefaultToEmpty();
144 }
145 _impl_.iid_ = ::uint64_t{0u};
146 _impl_._has_bits_.Clear();
147 _internal_metadata_.Clear<std::string>();
148 }
149
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)150 const char* HistogramName::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
151 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
152 _Internal::HasBits has_bits{};
153 while (!ctx->Done(&ptr)) {
154 ::uint32_t tag;
155 ptr = ::_pbi::ReadTag(ptr, &tag);
156 switch (tag >> 3) {
157 // optional uint64 iid = 1;
158 case 1:
159 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
160 _Internal::set_has_iid(&has_bits);
161 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
162 CHK_(ptr);
163 } else {
164 goto handle_unusual;
165 }
166 continue;
167 // optional string name = 2;
168 case 2:
169 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
170 auto str = _internal_mutable_name();
171 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
172 CHK_(ptr);
173 } else {
174 goto handle_unusual;
175 }
176 continue;
177 default:
178 goto handle_unusual;
179 } // switch
180 handle_unusual:
181 if ((tag == 0) || ((tag & 7) == 4)) {
182 CHK_(ptr);
183 ctx->SetLastTag(tag);
184 goto message_done;
185 }
186 ptr = UnknownFieldParse(
187 tag,
188 _internal_metadata_.mutable_unknown_fields<std::string>(),
189 ptr, ctx);
190 CHK_(ptr != nullptr);
191 } // while
192 message_done:
193 _impl_._has_bits_.Or(has_bits);
194 return ptr;
195 failure:
196 ptr = nullptr;
197 goto message_done;
198 #undef CHK_
199 }
200
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const201 ::uint8_t* HistogramName::_InternalSerialize(
202 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
203 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.HistogramName)
204 ::uint32_t cached_has_bits = 0;
205 (void) cached_has_bits;
206
207 cached_has_bits = _impl_._has_bits_[0];
208 // optional uint64 iid = 1;
209 if (cached_has_bits & 0x00000002u) {
210 target = stream->EnsureSpace(target);
211 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
212 }
213
214 // optional string name = 2;
215 if (cached_has_bits & 0x00000001u) {
216 target = stream->WriteStringMaybeAliased(
217 2, this->_internal_name(), target);
218 }
219
220 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
221 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
222 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
223 }
224 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.HistogramName)
225 return target;
226 }
227
ByteSizeLong() const228 size_t HistogramName::ByteSizeLong() const {
229 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.HistogramName)
230 size_t total_size = 0;
231
232 ::uint32_t cached_has_bits = 0;
233 // Prevent compiler warnings about cached_has_bits being unused
234 (void) cached_has_bits;
235
236 cached_has_bits = _impl_._has_bits_[0];
237 if (cached_has_bits & 0x00000003u) {
238 // optional string name = 2;
239 if (cached_has_bits & 0x00000001u) {
240 total_size += 1 +
241 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
242 this->_internal_name());
243 }
244
245 // optional uint64 iid = 1;
246 if (cached_has_bits & 0x00000002u) {
247 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
248 }
249
250 }
251 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
252 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
253 }
254 int cached_size = ::_pbi::ToCachedSize(total_size);
255 SetCachedSize(cached_size);
256 return total_size;
257 }
258
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)259 void HistogramName::CheckTypeAndMergeFrom(
260 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
261 MergeFrom(*::_pbi::DownCast<const HistogramName*>(
262 &from));
263 }
264
MergeFrom(const HistogramName & from)265 void HistogramName::MergeFrom(const HistogramName& from) {
266 HistogramName* const _this = this;
267 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.HistogramName)
268 GOOGLE_DCHECK_NE(&from, _this);
269 ::uint32_t cached_has_bits = 0;
270 (void) cached_has_bits;
271
272 cached_has_bits = from._impl_._has_bits_[0];
273 if (cached_has_bits & 0x00000003u) {
274 if (cached_has_bits & 0x00000001u) {
275 _this->_internal_set_name(from._internal_name());
276 }
277 if (cached_has_bits & 0x00000002u) {
278 _this->_impl_.iid_ = from._impl_.iid_;
279 }
280 _this->_impl_._has_bits_[0] |= cached_has_bits;
281 }
282 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
283 }
284
CopyFrom(const HistogramName & from)285 void HistogramName::CopyFrom(const HistogramName& from) {
286 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.HistogramName)
287 if (&from == this) return;
288 Clear();
289 MergeFrom(from);
290 }
291
IsInitialized() const292 bool HistogramName::IsInitialized() const {
293 return true;
294 }
295
InternalSwap(HistogramName * other)296 void HistogramName::InternalSwap(HistogramName* other) {
297 using std::swap;
298 auto* lhs_arena = GetArenaForAllocation();
299 auto* rhs_arena = other->GetArenaForAllocation();
300 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
301 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
302 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
303 &_impl_.name_, lhs_arena,
304 &other->_impl_.name_, rhs_arena
305 );
306 swap(_impl_.iid_, other->_impl_.iid_);
307 }
308
GetTypeName() const309 std::string HistogramName::GetTypeName() const {
310 return "perfetto.protos.HistogramName";
311 }
312
313
314 // ===================================================================
315
316 class ChromeHistogramSample::_Internal {
317 public:
318 using HasBits = decltype(std::declval<ChromeHistogramSample>()._impl_._has_bits_);
set_has_name_hash(HasBits * has_bits)319 static void set_has_name_hash(HasBits* has_bits) {
320 (*has_bits)[0] |= 2u;
321 }
set_has_name(HasBits * has_bits)322 static void set_has_name(HasBits* has_bits) {
323 (*has_bits)[0] |= 1u;
324 }
set_has_sample(HasBits * has_bits)325 static void set_has_sample(HasBits* has_bits) {
326 (*has_bits)[0] |= 4u;
327 }
set_has_name_iid(HasBits * has_bits)328 static void set_has_name_iid(HasBits* has_bits) {
329 (*has_bits)[0] |= 8u;
330 }
331 };
332
ChromeHistogramSample(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)333 ChromeHistogramSample::ChromeHistogramSample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
334 bool is_message_owned)
335 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
336 SharedCtor(arena, is_message_owned);
337 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ChromeHistogramSample)
338 }
ChromeHistogramSample(const ChromeHistogramSample & from)339 ChromeHistogramSample::ChromeHistogramSample(const ChromeHistogramSample& from)
340 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
341 ChromeHistogramSample* const _this = this; (void)_this;
342 new (&_impl_) Impl_{
343 decltype(_impl_._has_bits_){from._impl_._has_bits_}
344 , /*decltype(_impl_._cached_size_)*/{}
345 , decltype(_impl_.name_){}
346 , decltype(_impl_.name_hash_){}
347 , decltype(_impl_.sample_){}
348 , decltype(_impl_.name_iid_){}};
349
350 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
351 _impl_.name_.InitDefault();
352 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
353 _impl_.name_.Set("", GetArenaForAllocation());
354 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
355 if (from._internal_has_name()) {
356 _this->_impl_.name_.Set(from._internal_name(),
357 _this->GetArenaForAllocation());
358 }
359 ::memcpy(&_impl_.name_hash_, &from._impl_.name_hash_,
360 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.name_iid_) -
361 reinterpret_cast<char*>(&_impl_.name_hash_)) + sizeof(_impl_.name_iid_));
362 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ChromeHistogramSample)
363 }
364
SharedCtor(::_pb::Arena * arena,bool is_message_owned)365 inline void ChromeHistogramSample::SharedCtor(
366 ::_pb::Arena* arena, bool is_message_owned) {
367 (void)arena;
368 (void)is_message_owned;
369 new (&_impl_) Impl_{
370 decltype(_impl_._has_bits_){}
371 , /*decltype(_impl_._cached_size_)*/{}
372 , decltype(_impl_.name_){}
373 , decltype(_impl_.name_hash_){::uint64_t{0u}}
374 , decltype(_impl_.sample_){::int64_t{0}}
375 , decltype(_impl_.name_iid_){::uint64_t{0u}}
376 };
377 _impl_.name_.InitDefault();
378 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
379 _impl_.name_.Set("", GetArenaForAllocation());
380 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
381 }
382
~ChromeHistogramSample()383 ChromeHistogramSample::~ChromeHistogramSample() {
384 // @@protoc_insertion_point(destructor:perfetto.protos.ChromeHistogramSample)
385 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
386 (void)arena;
387 return;
388 }
389 SharedDtor();
390 }
391
SharedDtor()392 inline void ChromeHistogramSample::SharedDtor() {
393 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
394 _impl_.name_.Destroy();
395 }
396
SetCachedSize(int size) const397 void ChromeHistogramSample::SetCachedSize(int size) const {
398 _impl_._cached_size_.Set(size);
399 }
400
Clear()401 void ChromeHistogramSample::Clear() {
402 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ChromeHistogramSample)
403 ::uint32_t cached_has_bits = 0;
404 // Prevent compiler warnings about cached_has_bits being unused
405 (void) cached_has_bits;
406
407 cached_has_bits = _impl_._has_bits_[0];
408 if (cached_has_bits & 0x00000001u) {
409 _impl_.name_.ClearNonDefaultToEmpty();
410 }
411 if (cached_has_bits & 0x0000000eu) {
412 ::memset(&_impl_.name_hash_, 0, static_cast<size_t>(
413 reinterpret_cast<char*>(&_impl_.name_iid_) -
414 reinterpret_cast<char*>(&_impl_.name_hash_)) + sizeof(_impl_.name_iid_));
415 }
416 _impl_._has_bits_.Clear();
417 _internal_metadata_.Clear<std::string>();
418 }
419
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)420 const char* ChromeHistogramSample::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
421 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
422 _Internal::HasBits has_bits{};
423 while (!ctx->Done(&ptr)) {
424 ::uint32_t tag;
425 ptr = ::_pbi::ReadTag(ptr, &tag);
426 switch (tag >> 3) {
427 // optional uint64 name_hash = 1;
428 case 1:
429 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
430 _Internal::set_has_name_hash(&has_bits);
431 _impl_.name_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
432 CHK_(ptr);
433 } else {
434 goto handle_unusual;
435 }
436 continue;
437 // optional string name = 2;
438 case 2:
439 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
440 auto str = _internal_mutable_name();
441 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
442 CHK_(ptr);
443 } else {
444 goto handle_unusual;
445 }
446 continue;
447 // optional int64 sample = 3;
448 case 3:
449 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
450 _Internal::set_has_sample(&has_bits);
451 _impl_.sample_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
452 CHK_(ptr);
453 } else {
454 goto handle_unusual;
455 }
456 continue;
457 // optional uint64 name_iid = 4;
458 case 4:
459 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
460 _Internal::set_has_name_iid(&has_bits);
461 _impl_.name_iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
462 CHK_(ptr);
463 } else {
464 goto handle_unusual;
465 }
466 continue;
467 default:
468 goto handle_unusual;
469 } // switch
470 handle_unusual:
471 if ((tag == 0) || ((tag & 7) == 4)) {
472 CHK_(ptr);
473 ctx->SetLastTag(tag);
474 goto message_done;
475 }
476 ptr = UnknownFieldParse(
477 tag,
478 _internal_metadata_.mutable_unknown_fields<std::string>(),
479 ptr, ctx);
480 CHK_(ptr != nullptr);
481 } // while
482 message_done:
483 _impl_._has_bits_.Or(has_bits);
484 return ptr;
485 failure:
486 ptr = nullptr;
487 goto message_done;
488 #undef CHK_
489 }
490
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const491 ::uint8_t* ChromeHistogramSample::_InternalSerialize(
492 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
493 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ChromeHistogramSample)
494 ::uint32_t cached_has_bits = 0;
495 (void) cached_has_bits;
496
497 cached_has_bits = _impl_._has_bits_[0];
498 // optional uint64 name_hash = 1;
499 if (cached_has_bits & 0x00000002u) {
500 target = stream->EnsureSpace(target);
501 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_name_hash(), target);
502 }
503
504 // optional string name = 2;
505 if (cached_has_bits & 0x00000001u) {
506 target = stream->WriteStringMaybeAliased(
507 2, this->_internal_name(), target);
508 }
509
510 // optional int64 sample = 3;
511 if (cached_has_bits & 0x00000004u) {
512 target = stream->EnsureSpace(target);
513 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_sample(), target);
514 }
515
516 // optional uint64 name_iid = 4;
517 if (cached_has_bits & 0x00000008u) {
518 target = stream->EnsureSpace(target);
519 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_name_iid(), target);
520 }
521
522 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
523 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
524 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
525 }
526 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ChromeHistogramSample)
527 return target;
528 }
529
ByteSizeLong() const530 size_t ChromeHistogramSample::ByteSizeLong() const {
531 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ChromeHistogramSample)
532 size_t total_size = 0;
533
534 ::uint32_t cached_has_bits = 0;
535 // Prevent compiler warnings about cached_has_bits being unused
536 (void) cached_has_bits;
537
538 cached_has_bits = _impl_._has_bits_[0];
539 if (cached_has_bits & 0x0000000fu) {
540 // optional string name = 2;
541 if (cached_has_bits & 0x00000001u) {
542 total_size += 1 +
543 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
544 this->_internal_name());
545 }
546
547 // optional uint64 name_hash = 1;
548 if (cached_has_bits & 0x00000002u) {
549 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_name_hash());
550 }
551
552 // optional int64 sample = 3;
553 if (cached_has_bits & 0x00000004u) {
554 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_sample());
555 }
556
557 // optional uint64 name_iid = 4;
558 if (cached_has_bits & 0x00000008u) {
559 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_name_iid());
560 }
561
562 }
563 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
564 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
565 }
566 int cached_size = ::_pbi::ToCachedSize(total_size);
567 SetCachedSize(cached_size);
568 return total_size;
569 }
570
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)571 void ChromeHistogramSample::CheckTypeAndMergeFrom(
572 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
573 MergeFrom(*::_pbi::DownCast<const ChromeHistogramSample*>(
574 &from));
575 }
576
MergeFrom(const ChromeHistogramSample & from)577 void ChromeHistogramSample::MergeFrom(const ChromeHistogramSample& from) {
578 ChromeHistogramSample* const _this = this;
579 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ChromeHistogramSample)
580 GOOGLE_DCHECK_NE(&from, _this);
581 ::uint32_t cached_has_bits = 0;
582 (void) cached_has_bits;
583
584 cached_has_bits = from._impl_._has_bits_[0];
585 if (cached_has_bits & 0x0000000fu) {
586 if (cached_has_bits & 0x00000001u) {
587 _this->_internal_set_name(from._internal_name());
588 }
589 if (cached_has_bits & 0x00000002u) {
590 _this->_impl_.name_hash_ = from._impl_.name_hash_;
591 }
592 if (cached_has_bits & 0x00000004u) {
593 _this->_impl_.sample_ = from._impl_.sample_;
594 }
595 if (cached_has_bits & 0x00000008u) {
596 _this->_impl_.name_iid_ = from._impl_.name_iid_;
597 }
598 _this->_impl_._has_bits_[0] |= cached_has_bits;
599 }
600 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
601 }
602
CopyFrom(const ChromeHistogramSample & from)603 void ChromeHistogramSample::CopyFrom(const ChromeHistogramSample& from) {
604 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ChromeHistogramSample)
605 if (&from == this) return;
606 Clear();
607 MergeFrom(from);
608 }
609
IsInitialized() const610 bool ChromeHistogramSample::IsInitialized() const {
611 return true;
612 }
613
InternalSwap(ChromeHistogramSample * other)614 void ChromeHistogramSample::InternalSwap(ChromeHistogramSample* other) {
615 using std::swap;
616 auto* lhs_arena = GetArenaForAllocation();
617 auto* rhs_arena = other->GetArenaForAllocation();
618 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
619 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
620 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
621 &_impl_.name_, lhs_arena,
622 &other->_impl_.name_, rhs_arena
623 );
624 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
625 PROTOBUF_FIELD_OFFSET(ChromeHistogramSample, _impl_.name_iid_)
626 + sizeof(ChromeHistogramSample::_impl_.name_iid_) // NOLINT
627 - PROTOBUF_FIELD_OFFSET(ChromeHistogramSample, _impl_.name_hash_)>(
628 reinterpret_cast<char*>(&_impl_.name_hash_),
629 reinterpret_cast<char*>(&other->_impl_.name_hash_));
630 }
631
GetTypeName() const632 std::string ChromeHistogramSample::GetTypeName() const {
633 return "perfetto.protos.ChromeHistogramSample";
634 }
635
636
637 // @@protoc_insertion_point(namespace_scope)
638 } // namespace protos
639 } // namespace perfetto
640 PROTOBUF_NAMESPACE_OPEN
641 template<> PROTOBUF_NOINLINE ::perfetto::protos::HistogramName*
CreateMaybeMessage(Arena * arena)642 Arena::CreateMaybeMessage< ::perfetto::protos::HistogramName >(Arena* arena) {
643 return Arena::CreateMessageInternal< ::perfetto::protos::HistogramName >(arena);
644 }
645 template<> PROTOBUF_NOINLINE ::perfetto::protos::ChromeHistogramSample*
CreateMaybeMessage(Arena * arena)646 Arena::CreateMaybeMessage< ::perfetto::protos::ChromeHistogramSample >(Arena* arena) {
647 return Arena::CreateMessageInternal< ::perfetto::protos::ChromeHistogramSample >(arena);
648 }
649 PROTOBUF_NAMESPACE_CLOSE
650
651 // @@protoc_insertion_point(global_scope)
652 #include <google/protobuf/port_undef.inc>
653