1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
3
4 #include "protos/perfetto/trace/track_event/chrome_thread_descriptor.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 {
ChromeThreadDescriptor(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ChromeThreadDescriptor::ChromeThreadDescriptor(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.thread_type_)*/0
28 , /*decltype(_impl_.legacy_sort_index_)*/0} {}
29 struct ChromeThreadDescriptorDefaultTypeInternal {
ChromeThreadDescriptorDefaultTypeInternalperfetto::protos::ChromeThreadDescriptorDefaultTypeInternal30 PROTOBUF_CONSTEXPR ChromeThreadDescriptorDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~ChromeThreadDescriptorDefaultTypeInternalperfetto::protos::ChromeThreadDescriptorDefaultTypeInternal32 ~ChromeThreadDescriptorDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 ChromeThreadDescriptor _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChromeThreadDescriptorDefaultTypeInternal _ChromeThreadDescriptor_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
ChromeThreadDescriptor_ThreadType_IsValid(int value)42 bool ChromeThreadDescriptor_ThreadType_IsValid(int value) {
43 switch (value) {
44 case 0:
45 case 1:
46 case 2:
47 case 3:
48 case 4:
49 case 5:
50 case 6:
51 case 7:
52 case 8:
53 case 9:
54 case 10:
55 case 11:
56 case 12:
57 case 13:
58 case 14:
59 case 15:
60 case 16:
61 case 17:
62 case 18:
63 case 19:
64 case 20:
65 case 21:
66 case 22:
67 case 23:
68 case 24:
69 case 25:
70 case 26:
71 case 27:
72 case 28:
73 case 29:
74 case 30:
75 case 31:
76 case 32:
77 case 33:
78 case 34:
79 case 35:
80 case 36:
81 case 37:
82 case 38:
83 case 39:
84 case 40:
85 case 41:
86 case 50:
87 case 51:
88 case 52:
89 return true;
90 default:
91 return false;
92 }
93 }
94
95 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ChromeThreadDescriptor_ThreadType_strings[45] = {};
96
97 static const char ChromeThreadDescriptor_ThreadType_names[] =
98 "THREAD_AUDIO_INPUTDEVICE"
99 "THREAD_AUDIO_OUTPUTDEVICE"
100 "THREAD_BROWSER_IO"
101 "THREAD_BROWSER_MAIN"
102 "THREAD_BROWSER_WATCHDOG"
103 "THREAD_CACHE_BLOCKFILE"
104 "THREAD_CHILD_IO"
105 "THREAD_COMPOSITOR"
106 "THREAD_COMPOSITOR_GPU"
107 "THREAD_COMPOSITOR_WORKER"
108 "THREAD_DATABASE"
109 "THREAD_DEVTOOLSADB"
110 "THREAD_DXA_VIDEODECODER"
111 "THREAD_GAMEPAD_POLLING"
112 "THREAD_GPU_MAIN"
113 "THREAD_GPU_MEMORY"
114 "THREAD_GPU_VSYNC"
115 "THREAD_GPU_WATCHDOG"
116 "THREAD_IO"
117 "THREAD_LOADER_LOCK_SAMPLER"
118 "THREAD_MAIN"
119 "THREAD_MEDIA"
120 "THREAD_MEMORY_INFRA"
121 "THREAD_NETWORKCONFIGWATCHER"
122 "THREAD_NETWORK_SERVICE"
123 "THREAD_POOL_BG_BLOCKING"
124 "THREAD_POOL_BG_WORKER"
125 "THREAD_POOL_FG_BLOCKING"
126 "THREAD_POOL_FG_WORKER"
127 "THREAD_POOL_SERVICE"
128 "THREAD_PPAPI_MAIN"
129 "THREAD_PROXYRESOLVER"
130 "THREAD_RENDERER_MAIN"
131 "THREAD_SAMPLING_PROFILER"
132 "THREAD_SERVICE_WORKER"
133 "THREAD_SWAPPER"
134 "THREAD_UNSPECIFIED"
135 "THREAD_UTILITY_MAIN"
136 "THREAD_VIZ_COMPOSITOR"
137 "THREAD_WASAPI_RENDER"
138 "THREAD_WEBCRYPTO"
139 "THREAD_WEBRTC_NETWORK"
140 "THREAD_WEBRTC_SIGNALING"
141 "THREAD_WEBRTC_WORKER"
142 "THREAD_WINDOW_OWNER";
143
144 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ChromeThreadDescriptor_ThreadType_entries[] = {
145 { {ChromeThreadDescriptor_ThreadType_names + 0, 24}, 22 },
146 { {ChromeThreadDescriptor_ThreadType_names + 24, 25}, 21 },
147 { {ChromeThreadDescriptor_ThreadType_names + 49, 17}, 14 },
148 { {ChromeThreadDescriptor_ThreadType_names + 66, 19}, 15 },
149 { {ChromeThreadDescriptor_ThreadType_names + 85, 23}, 26 },
150 { {ChromeThreadDescriptor_ThreadType_names + 108, 22}, 19 },
151 { {ChromeThreadDescriptor_ThreadType_names + 130, 15}, 13 },
152 { {ChromeThreadDescriptor_ThreadType_names + 145, 17}, 8 },
153 { {ChromeThreadDescriptor_ThreadType_names + 162, 21}, 52 },
154 { {ChromeThreadDescriptor_ThreadType_names + 183, 24}, 10 },
155 { {ChromeThreadDescriptor_ThreadType_names + 207, 15}, 36 },
156 { {ChromeThreadDescriptor_ThreadType_names + 222, 18}, 38 },
157 { {ChromeThreadDescriptor_ThreadType_names + 240, 23}, 25 },
158 { {ChromeThreadDescriptor_ThreadType_names + 263, 22}, 34 },
159 { {ChromeThreadDescriptor_ThreadType_names + 285, 15}, 18 },
160 { {ChromeThreadDescriptor_ThreadType_names + 300, 17}, 23 },
161 { {ChromeThreadDescriptor_ThreadType_names + 317, 16}, 24 },
162 { {ChromeThreadDescriptor_ThreadType_names + 333, 19}, 32 },
163 { {ChromeThreadDescriptor_ThreadType_names + 352, 9}, 2 },
164 { {ChromeThreadDescriptor_ThreadType_names + 361, 26}, 41 },
165 { {ChromeThreadDescriptor_ThreadType_names + 387, 11}, 1 },
166 { {ChromeThreadDescriptor_ThreadType_names + 398, 12}, 20 },
167 { {ChromeThreadDescriptor_ThreadType_names + 410, 19}, 50 },
168 { {ChromeThreadDescriptor_ThreadType_names + 429, 27}, 39 },
169 { {ChromeThreadDescriptor_ThreadType_names + 456, 22}, 12 },
170 { {ChromeThreadDescriptor_ThreadType_names + 478, 23}, 6 },
171 { {ChromeThreadDescriptor_ThreadType_names + 501, 21}, 3 },
172 { {ChromeThreadDescriptor_ThreadType_names + 522, 23}, 5 },
173 { {ChromeThreadDescriptor_ThreadType_names + 545, 21}, 4 },
174 { {ChromeThreadDescriptor_ThreadType_names + 566, 19}, 7 },
175 { {ChromeThreadDescriptor_ThreadType_names + 585, 17}, 31 },
176 { {ChromeThreadDescriptor_ThreadType_names + 602, 20}, 37 },
177 { {ChromeThreadDescriptor_ThreadType_names + 622, 20}, 16 },
178 { {ChromeThreadDescriptor_ThreadType_names + 642, 24}, 51 },
179 { {ChromeThreadDescriptor_ThreadType_names + 666, 21}, 11 },
180 { {ChromeThreadDescriptor_ThreadType_names + 687, 14}, 33 },
181 { {ChromeThreadDescriptor_ThreadType_names + 701, 18}, 0 },
182 { {ChromeThreadDescriptor_ThreadType_names + 719, 19}, 17 },
183 { {ChromeThreadDescriptor_ThreadType_names + 738, 21}, 9 },
184 { {ChromeThreadDescriptor_ThreadType_names + 759, 20}, 40 },
185 { {ChromeThreadDescriptor_ThreadType_names + 779, 16}, 35 },
186 { {ChromeThreadDescriptor_ThreadType_names + 795, 21}, 27 },
187 { {ChromeThreadDescriptor_ThreadType_names + 816, 23}, 29 },
188 { {ChromeThreadDescriptor_ThreadType_names + 839, 20}, 30 },
189 { {ChromeThreadDescriptor_ThreadType_names + 859, 19}, 28 },
190 };
191
192 static const int ChromeThreadDescriptor_ThreadType_entries_by_number[] = {
193 36, // 0 -> THREAD_UNSPECIFIED
194 20, // 1 -> THREAD_MAIN
195 18, // 2 -> THREAD_IO
196 26, // 3 -> THREAD_POOL_BG_WORKER
197 28, // 4 -> THREAD_POOL_FG_WORKER
198 27, // 5 -> THREAD_POOL_FG_BLOCKING
199 25, // 6 -> THREAD_POOL_BG_BLOCKING
200 29, // 7 -> THREAD_POOL_SERVICE
201 7, // 8 -> THREAD_COMPOSITOR
202 38, // 9 -> THREAD_VIZ_COMPOSITOR
203 9, // 10 -> THREAD_COMPOSITOR_WORKER
204 34, // 11 -> THREAD_SERVICE_WORKER
205 24, // 12 -> THREAD_NETWORK_SERVICE
206 6, // 13 -> THREAD_CHILD_IO
207 2, // 14 -> THREAD_BROWSER_IO
208 3, // 15 -> THREAD_BROWSER_MAIN
209 32, // 16 -> THREAD_RENDERER_MAIN
210 37, // 17 -> THREAD_UTILITY_MAIN
211 14, // 18 -> THREAD_GPU_MAIN
212 5, // 19 -> THREAD_CACHE_BLOCKFILE
213 21, // 20 -> THREAD_MEDIA
214 1, // 21 -> THREAD_AUDIO_OUTPUTDEVICE
215 0, // 22 -> THREAD_AUDIO_INPUTDEVICE
216 15, // 23 -> THREAD_GPU_MEMORY
217 16, // 24 -> THREAD_GPU_VSYNC
218 12, // 25 -> THREAD_DXA_VIDEODECODER
219 4, // 26 -> THREAD_BROWSER_WATCHDOG
220 41, // 27 -> THREAD_WEBRTC_NETWORK
221 44, // 28 -> THREAD_WINDOW_OWNER
222 42, // 29 -> THREAD_WEBRTC_SIGNALING
223 43, // 30 -> THREAD_WEBRTC_WORKER
224 30, // 31 -> THREAD_PPAPI_MAIN
225 17, // 32 -> THREAD_GPU_WATCHDOG
226 35, // 33 -> THREAD_SWAPPER
227 13, // 34 -> THREAD_GAMEPAD_POLLING
228 40, // 35 -> THREAD_WEBCRYPTO
229 10, // 36 -> THREAD_DATABASE
230 31, // 37 -> THREAD_PROXYRESOLVER
231 11, // 38 -> THREAD_DEVTOOLSADB
232 23, // 39 -> THREAD_NETWORKCONFIGWATCHER
233 39, // 40 -> THREAD_WASAPI_RENDER
234 19, // 41 -> THREAD_LOADER_LOCK_SAMPLER
235 22, // 50 -> THREAD_MEMORY_INFRA
236 33, // 51 -> THREAD_SAMPLING_PROFILER
237 8, // 52 -> THREAD_COMPOSITOR_GPU
238 };
239
ChromeThreadDescriptor_ThreadType_Name(ChromeThreadDescriptor_ThreadType value)240 const std::string& ChromeThreadDescriptor_ThreadType_Name(
241 ChromeThreadDescriptor_ThreadType value) {
242 static const bool dummy =
243 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
244 ChromeThreadDescriptor_ThreadType_entries,
245 ChromeThreadDescriptor_ThreadType_entries_by_number,
246 45, ChromeThreadDescriptor_ThreadType_strings);
247 (void) dummy;
248 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
249 ChromeThreadDescriptor_ThreadType_entries,
250 ChromeThreadDescriptor_ThreadType_entries_by_number,
251 45, value);
252 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
253 ChromeThreadDescriptor_ThreadType_strings[idx].get();
254 }
ChromeThreadDescriptor_ThreadType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ChromeThreadDescriptor_ThreadType * value)255 bool ChromeThreadDescriptor_ThreadType_Parse(
256 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ChromeThreadDescriptor_ThreadType* value) {
257 int int_value;
258 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
259 ChromeThreadDescriptor_ThreadType_entries, 45, name, &int_value);
260 if (success) {
261 *value = static_cast<ChromeThreadDescriptor_ThreadType>(int_value);
262 }
263 return success;
264 }
265 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
266 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_UNSPECIFIED;
267 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_MAIN;
268 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_IO;
269 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_POOL_BG_WORKER;
270 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_POOL_FG_WORKER;
271 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_POOL_FG_BLOCKING;
272 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_POOL_BG_BLOCKING;
273 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_POOL_SERVICE;
274 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_COMPOSITOR;
275 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_VIZ_COMPOSITOR;
276 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_COMPOSITOR_WORKER;
277 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_SERVICE_WORKER;
278 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_NETWORK_SERVICE;
279 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_CHILD_IO;
280 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_BROWSER_IO;
281 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_BROWSER_MAIN;
282 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_RENDERER_MAIN;
283 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_UTILITY_MAIN;
284 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_GPU_MAIN;
285 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_CACHE_BLOCKFILE;
286 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_MEDIA;
287 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_AUDIO_OUTPUTDEVICE;
288 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_AUDIO_INPUTDEVICE;
289 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_GPU_MEMORY;
290 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_GPU_VSYNC;
291 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_DXA_VIDEODECODER;
292 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_BROWSER_WATCHDOG;
293 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WEBRTC_NETWORK;
294 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WINDOW_OWNER;
295 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WEBRTC_SIGNALING;
296 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WEBRTC_WORKER;
297 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_PPAPI_MAIN;
298 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_GPU_WATCHDOG;
299 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_SWAPPER;
300 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_GAMEPAD_POLLING;
301 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WEBCRYPTO;
302 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_DATABASE;
303 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_PROXYRESOLVER;
304 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_DEVTOOLSADB;
305 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_NETWORKCONFIGWATCHER;
306 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_WASAPI_RENDER;
307 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_LOADER_LOCK_SAMPLER;
308 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_MEMORY_INFRA;
309 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_SAMPLING_PROFILER;
310 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::THREAD_COMPOSITOR_GPU;
311 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::ThreadType_MIN;
312 constexpr ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor::ThreadType_MAX;
313 constexpr int ChromeThreadDescriptor::ThreadType_ARRAYSIZE;
314 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
315
316 // ===================================================================
317
318 class ChromeThreadDescriptor::_Internal {
319 public:
320 using HasBits = decltype(std::declval<ChromeThreadDescriptor>()._impl_._has_bits_);
set_has_thread_type(HasBits * has_bits)321 static void set_has_thread_type(HasBits* has_bits) {
322 (*has_bits)[0] |= 1u;
323 }
set_has_legacy_sort_index(HasBits * has_bits)324 static void set_has_legacy_sort_index(HasBits* has_bits) {
325 (*has_bits)[0] |= 2u;
326 }
327 };
328
ChromeThreadDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)329 ChromeThreadDescriptor::ChromeThreadDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
330 bool is_message_owned)
331 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
332 SharedCtor(arena, is_message_owned);
333 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ChromeThreadDescriptor)
334 }
ChromeThreadDescriptor(const ChromeThreadDescriptor & from)335 ChromeThreadDescriptor::ChromeThreadDescriptor(const ChromeThreadDescriptor& from)
336 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
337 ChromeThreadDescriptor* const _this = this; (void)_this;
338 new (&_impl_) Impl_{
339 decltype(_impl_._has_bits_){from._impl_._has_bits_}
340 , /*decltype(_impl_._cached_size_)*/{}
341 , decltype(_impl_.thread_type_){}
342 , decltype(_impl_.legacy_sort_index_){}};
343
344 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
345 ::memcpy(&_impl_.thread_type_, &from._impl_.thread_type_,
346 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.legacy_sort_index_) -
347 reinterpret_cast<char*>(&_impl_.thread_type_)) + sizeof(_impl_.legacy_sort_index_));
348 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ChromeThreadDescriptor)
349 }
350
SharedCtor(::_pb::Arena * arena,bool is_message_owned)351 inline void ChromeThreadDescriptor::SharedCtor(
352 ::_pb::Arena* arena, bool is_message_owned) {
353 (void)arena;
354 (void)is_message_owned;
355 new (&_impl_) Impl_{
356 decltype(_impl_._has_bits_){}
357 , /*decltype(_impl_._cached_size_)*/{}
358 , decltype(_impl_.thread_type_){0}
359 , decltype(_impl_.legacy_sort_index_){0}
360 };
361 }
362
~ChromeThreadDescriptor()363 ChromeThreadDescriptor::~ChromeThreadDescriptor() {
364 // @@protoc_insertion_point(destructor:perfetto.protos.ChromeThreadDescriptor)
365 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
366 (void)arena;
367 return;
368 }
369 SharedDtor();
370 }
371
SharedDtor()372 inline void ChromeThreadDescriptor::SharedDtor() {
373 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
374 }
375
SetCachedSize(int size) const376 void ChromeThreadDescriptor::SetCachedSize(int size) const {
377 _impl_._cached_size_.Set(size);
378 }
379
Clear()380 void ChromeThreadDescriptor::Clear() {
381 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ChromeThreadDescriptor)
382 ::uint32_t cached_has_bits = 0;
383 // Prevent compiler warnings about cached_has_bits being unused
384 (void) cached_has_bits;
385
386 cached_has_bits = _impl_._has_bits_[0];
387 if (cached_has_bits & 0x00000003u) {
388 ::memset(&_impl_.thread_type_, 0, static_cast<size_t>(
389 reinterpret_cast<char*>(&_impl_.legacy_sort_index_) -
390 reinterpret_cast<char*>(&_impl_.thread_type_)) + sizeof(_impl_.legacy_sort_index_));
391 }
392 _impl_._has_bits_.Clear();
393 _internal_metadata_.Clear<std::string>();
394 }
395
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)396 const char* ChromeThreadDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
397 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
398 _Internal::HasBits has_bits{};
399 while (!ctx->Done(&ptr)) {
400 ::uint32_t tag;
401 ptr = ::_pbi::ReadTag(ptr, &tag);
402 switch (tag >> 3) {
403 // optional .perfetto.protos.ChromeThreadDescriptor.ThreadType thread_type = 1;
404 case 1:
405 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
406 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
407 CHK_(ptr);
408 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ChromeThreadDescriptor_ThreadType_IsValid(val))) {
409 _internal_set_thread_type(static_cast<::perfetto::protos::ChromeThreadDescriptor_ThreadType>(val));
410 } else {
411 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
412 }
413 } else {
414 goto handle_unusual;
415 }
416 continue;
417 // optional int32 legacy_sort_index = 2;
418 case 2:
419 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
420 _Internal::set_has_legacy_sort_index(&has_bits);
421 _impl_.legacy_sort_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
422 CHK_(ptr);
423 } else {
424 goto handle_unusual;
425 }
426 continue;
427 default:
428 goto handle_unusual;
429 } // switch
430 handle_unusual:
431 if ((tag == 0) || ((tag & 7) == 4)) {
432 CHK_(ptr);
433 ctx->SetLastTag(tag);
434 goto message_done;
435 }
436 ptr = UnknownFieldParse(
437 tag,
438 _internal_metadata_.mutable_unknown_fields<std::string>(),
439 ptr, ctx);
440 CHK_(ptr != nullptr);
441 } // while
442 message_done:
443 _impl_._has_bits_.Or(has_bits);
444 return ptr;
445 failure:
446 ptr = nullptr;
447 goto message_done;
448 #undef CHK_
449 }
450
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const451 ::uint8_t* ChromeThreadDescriptor::_InternalSerialize(
452 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
453 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ChromeThreadDescriptor)
454 ::uint32_t cached_has_bits = 0;
455 (void) cached_has_bits;
456
457 cached_has_bits = _impl_._has_bits_[0];
458 // optional .perfetto.protos.ChromeThreadDescriptor.ThreadType thread_type = 1;
459 if (cached_has_bits & 0x00000001u) {
460 target = stream->EnsureSpace(target);
461 target = ::_pbi::WireFormatLite::WriteEnumToArray(
462 1, this->_internal_thread_type(), target);
463 }
464
465 // optional int32 legacy_sort_index = 2;
466 if (cached_has_bits & 0x00000002u) {
467 target = stream->EnsureSpace(target);
468 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_legacy_sort_index(), target);
469 }
470
471 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
472 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
473 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
474 }
475 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ChromeThreadDescriptor)
476 return target;
477 }
478
ByteSizeLong() const479 size_t ChromeThreadDescriptor::ByteSizeLong() const {
480 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ChromeThreadDescriptor)
481 size_t total_size = 0;
482
483 ::uint32_t cached_has_bits = 0;
484 // Prevent compiler warnings about cached_has_bits being unused
485 (void) cached_has_bits;
486
487 cached_has_bits = _impl_._has_bits_[0];
488 if (cached_has_bits & 0x00000003u) {
489 // optional .perfetto.protos.ChromeThreadDescriptor.ThreadType thread_type = 1;
490 if (cached_has_bits & 0x00000001u) {
491 total_size += 1 +
492 ::_pbi::WireFormatLite::EnumSize(this->_internal_thread_type());
493 }
494
495 // optional int32 legacy_sort_index = 2;
496 if (cached_has_bits & 0x00000002u) {
497 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_legacy_sort_index());
498 }
499
500 }
501 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
502 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
503 }
504 int cached_size = ::_pbi::ToCachedSize(total_size);
505 SetCachedSize(cached_size);
506 return total_size;
507 }
508
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)509 void ChromeThreadDescriptor::CheckTypeAndMergeFrom(
510 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
511 MergeFrom(*::_pbi::DownCast<const ChromeThreadDescriptor*>(
512 &from));
513 }
514
MergeFrom(const ChromeThreadDescriptor & from)515 void ChromeThreadDescriptor::MergeFrom(const ChromeThreadDescriptor& from) {
516 ChromeThreadDescriptor* const _this = this;
517 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ChromeThreadDescriptor)
518 GOOGLE_DCHECK_NE(&from, _this);
519 ::uint32_t cached_has_bits = 0;
520 (void) cached_has_bits;
521
522 cached_has_bits = from._impl_._has_bits_[0];
523 if (cached_has_bits & 0x00000003u) {
524 if (cached_has_bits & 0x00000001u) {
525 _this->_impl_.thread_type_ = from._impl_.thread_type_;
526 }
527 if (cached_has_bits & 0x00000002u) {
528 _this->_impl_.legacy_sort_index_ = from._impl_.legacy_sort_index_;
529 }
530 _this->_impl_._has_bits_[0] |= cached_has_bits;
531 }
532 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
533 }
534
CopyFrom(const ChromeThreadDescriptor & from)535 void ChromeThreadDescriptor::CopyFrom(const ChromeThreadDescriptor& from) {
536 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ChromeThreadDescriptor)
537 if (&from == this) return;
538 Clear();
539 MergeFrom(from);
540 }
541
IsInitialized() const542 bool ChromeThreadDescriptor::IsInitialized() const {
543 return true;
544 }
545
InternalSwap(ChromeThreadDescriptor * other)546 void ChromeThreadDescriptor::InternalSwap(ChromeThreadDescriptor* other) {
547 using std::swap;
548 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
549 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
550 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
551 PROTOBUF_FIELD_OFFSET(ChromeThreadDescriptor, _impl_.legacy_sort_index_)
552 + sizeof(ChromeThreadDescriptor::_impl_.legacy_sort_index_) // NOLINT
553 - PROTOBUF_FIELD_OFFSET(ChromeThreadDescriptor, _impl_.thread_type_)>(
554 reinterpret_cast<char*>(&_impl_.thread_type_),
555 reinterpret_cast<char*>(&other->_impl_.thread_type_));
556 }
557
GetTypeName() const558 std::string ChromeThreadDescriptor::GetTypeName() const {
559 return "perfetto.protos.ChromeThreadDescriptor";
560 }
561
562
563 // @@protoc_insertion_point(namespace_scope)
564 } // namespace protos
565 } // namespace perfetto
566 PROTOBUF_NAMESPACE_OPEN
567 template<> PROTOBUF_NOINLINE ::perfetto::protos::ChromeThreadDescriptor*
CreateMaybeMessage(Arena * arena)568 Arena::CreateMaybeMessage< ::perfetto::protos::ChromeThreadDescriptor >(Arena* arena) {
569 return Arena::CreateMessageInternal< ::perfetto::protos::ChromeThreadDescriptor >(arena);
570 }
571 PROTOBUF_NAMESPACE_CLOSE
572
573 // @@protoc_insertion_point(global_scope)
574 #include <google/protobuf/port_undef.inc>
575