1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/chrome/chrome_trigger.proto
3
4 #include "protos/perfetto/trace/chrome/chrome_trigger.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 {
ChromeTrigger(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ChromeTrigger::ChromeTrigger(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.trigger_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.flow_id_)*/::uint64_t{0u}
29 , /*decltype(_impl_.trigger_name_hash_)*/0u} {}
30 struct ChromeTriggerDefaultTypeInternal {
ChromeTriggerDefaultTypeInternalperfetto::protos::ChromeTriggerDefaultTypeInternal31 PROTOBUF_CONSTEXPR ChromeTriggerDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~ChromeTriggerDefaultTypeInternalperfetto::protos::ChromeTriggerDefaultTypeInternal33 ~ChromeTriggerDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 ChromeTrigger _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChromeTriggerDefaultTypeInternal _ChromeTrigger_default_instance_;
39 } // namespace protos
40 } // namespace perfetto
41 namespace perfetto {
42 namespace protos {
43
44 // ===================================================================
45
46 class ChromeTrigger::_Internal {
47 public:
48 using HasBits = decltype(std::declval<ChromeTrigger>()._impl_._has_bits_);
set_has_trigger_name(HasBits * has_bits)49 static void set_has_trigger_name(HasBits* has_bits) {
50 (*has_bits)[0] |= 1u;
51 }
set_has_trigger_name_hash(HasBits * has_bits)52 static void set_has_trigger_name_hash(HasBits* has_bits) {
53 (*has_bits)[0] |= 4u;
54 }
set_has_flow_id(HasBits * has_bits)55 static void set_has_flow_id(HasBits* has_bits) {
56 (*has_bits)[0] |= 2u;
57 }
58 };
59
ChromeTrigger(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)60 ChromeTrigger::ChromeTrigger(::PROTOBUF_NAMESPACE_ID::Arena* arena,
61 bool is_message_owned)
62 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
63 SharedCtor(arena, is_message_owned);
64 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ChromeTrigger)
65 }
ChromeTrigger(const ChromeTrigger & from)66 ChromeTrigger::ChromeTrigger(const ChromeTrigger& from)
67 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
68 ChromeTrigger* const _this = this; (void)_this;
69 new (&_impl_) Impl_{
70 decltype(_impl_._has_bits_){from._impl_._has_bits_}
71 , /*decltype(_impl_._cached_size_)*/{}
72 , decltype(_impl_.trigger_name_){}
73 , decltype(_impl_.flow_id_){}
74 , decltype(_impl_.trigger_name_hash_){}};
75
76 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
77 _impl_.trigger_name_.InitDefault();
78 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
79 _impl_.trigger_name_.Set("", GetArenaForAllocation());
80 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
81 if (from._internal_has_trigger_name()) {
82 _this->_impl_.trigger_name_.Set(from._internal_trigger_name(),
83 _this->GetArenaForAllocation());
84 }
85 ::memcpy(&_impl_.flow_id_, &from._impl_.flow_id_,
86 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.trigger_name_hash_) -
87 reinterpret_cast<char*>(&_impl_.flow_id_)) + sizeof(_impl_.trigger_name_hash_));
88 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ChromeTrigger)
89 }
90
SharedCtor(::_pb::Arena * arena,bool is_message_owned)91 inline void ChromeTrigger::SharedCtor(
92 ::_pb::Arena* arena, bool is_message_owned) {
93 (void)arena;
94 (void)is_message_owned;
95 new (&_impl_) Impl_{
96 decltype(_impl_._has_bits_){}
97 , /*decltype(_impl_._cached_size_)*/{}
98 , decltype(_impl_.trigger_name_){}
99 , decltype(_impl_.flow_id_){::uint64_t{0u}}
100 , decltype(_impl_.trigger_name_hash_){0u}
101 };
102 _impl_.trigger_name_.InitDefault();
103 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
104 _impl_.trigger_name_.Set("", GetArenaForAllocation());
105 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
106 }
107
~ChromeTrigger()108 ChromeTrigger::~ChromeTrigger() {
109 // @@protoc_insertion_point(destructor:perfetto.protos.ChromeTrigger)
110 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
111 (void)arena;
112 return;
113 }
114 SharedDtor();
115 }
116
SharedDtor()117 inline void ChromeTrigger::SharedDtor() {
118 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
119 _impl_.trigger_name_.Destroy();
120 }
121
SetCachedSize(int size) const122 void ChromeTrigger::SetCachedSize(int size) const {
123 _impl_._cached_size_.Set(size);
124 }
125
Clear()126 void ChromeTrigger::Clear() {
127 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ChromeTrigger)
128 ::uint32_t cached_has_bits = 0;
129 // Prevent compiler warnings about cached_has_bits being unused
130 (void) cached_has_bits;
131
132 cached_has_bits = _impl_._has_bits_[0];
133 if (cached_has_bits & 0x00000001u) {
134 _impl_.trigger_name_.ClearNonDefaultToEmpty();
135 }
136 if (cached_has_bits & 0x00000006u) {
137 ::memset(&_impl_.flow_id_, 0, static_cast<size_t>(
138 reinterpret_cast<char*>(&_impl_.trigger_name_hash_) -
139 reinterpret_cast<char*>(&_impl_.flow_id_)) + sizeof(_impl_.trigger_name_hash_));
140 }
141 _impl_._has_bits_.Clear();
142 _internal_metadata_.Clear<std::string>();
143 }
144
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)145 const char* ChromeTrigger::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
146 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
147 _Internal::HasBits has_bits{};
148 while (!ctx->Done(&ptr)) {
149 ::uint32_t tag;
150 ptr = ::_pbi::ReadTag(ptr, &tag);
151 switch (tag >> 3) {
152 // optional string trigger_name = 1;
153 case 1:
154 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
155 auto str = _internal_mutable_trigger_name();
156 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
157 CHK_(ptr);
158 } else {
159 goto handle_unusual;
160 }
161 continue;
162 // optional fixed32 trigger_name_hash = 2;
163 case 2:
164 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 21)) {
165 _Internal::set_has_trigger_name_hash(&has_bits);
166 _impl_.trigger_name_hash_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint32_t>(ptr);
167 ptr += sizeof(::uint32_t);
168 } else {
169 goto handle_unusual;
170 }
171 continue;
172 // optional fixed64 flow_id = 3;
173 case 3:
174 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 25)) {
175 _Internal::set_has_flow_id(&has_bits);
176 _impl_.flow_id_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
177 ptr += sizeof(::uint64_t);
178 } else {
179 goto handle_unusual;
180 }
181 continue;
182 default:
183 goto handle_unusual;
184 } // switch
185 handle_unusual:
186 if ((tag == 0) || ((tag & 7) == 4)) {
187 CHK_(ptr);
188 ctx->SetLastTag(tag);
189 goto message_done;
190 }
191 ptr = UnknownFieldParse(
192 tag,
193 _internal_metadata_.mutable_unknown_fields<std::string>(),
194 ptr, ctx);
195 CHK_(ptr != nullptr);
196 } // while
197 message_done:
198 _impl_._has_bits_.Or(has_bits);
199 return ptr;
200 failure:
201 ptr = nullptr;
202 goto message_done;
203 #undef CHK_
204 }
205
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const206 ::uint8_t* ChromeTrigger::_InternalSerialize(
207 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
208 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ChromeTrigger)
209 ::uint32_t cached_has_bits = 0;
210 (void) cached_has_bits;
211
212 cached_has_bits = _impl_._has_bits_[0];
213 // optional string trigger_name = 1;
214 if (cached_has_bits & 0x00000001u) {
215 target = stream->WriteStringMaybeAliased(
216 1, this->_internal_trigger_name(), target);
217 }
218
219 // optional fixed32 trigger_name_hash = 2;
220 if (cached_has_bits & 0x00000004u) {
221 target = stream->EnsureSpace(target);
222 target = ::_pbi::WireFormatLite::WriteFixed32ToArray(2, this->_internal_trigger_name_hash(), target);
223 }
224
225 // optional fixed64 flow_id = 3;
226 if (cached_has_bits & 0x00000002u) {
227 target = stream->EnsureSpace(target);
228 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(3, this->_internal_flow_id(), target);
229 }
230
231 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
232 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
233 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
234 }
235 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ChromeTrigger)
236 return target;
237 }
238
ByteSizeLong() const239 size_t ChromeTrigger::ByteSizeLong() const {
240 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ChromeTrigger)
241 size_t total_size = 0;
242
243 ::uint32_t cached_has_bits = 0;
244 // Prevent compiler warnings about cached_has_bits being unused
245 (void) cached_has_bits;
246
247 cached_has_bits = _impl_._has_bits_[0];
248 if (cached_has_bits & 0x00000007u) {
249 // optional string trigger_name = 1;
250 if (cached_has_bits & 0x00000001u) {
251 total_size += 1 +
252 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
253 this->_internal_trigger_name());
254 }
255
256 // optional fixed64 flow_id = 3;
257 if (cached_has_bits & 0x00000002u) {
258 total_size += 1 + 8;
259 }
260
261 // optional fixed32 trigger_name_hash = 2;
262 if (cached_has_bits & 0x00000004u) {
263 total_size += 1 + 4;
264 }
265
266 }
267 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
268 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
269 }
270 int cached_size = ::_pbi::ToCachedSize(total_size);
271 SetCachedSize(cached_size);
272 return total_size;
273 }
274
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)275 void ChromeTrigger::CheckTypeAndMergeFrom(
276 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
277 MergeFrom(*::_pbi::DownCast<const ChromeTrigger*>(
278 &from));
279 }
280
MergeFrom(const ChromeTrigger & from)281 void ChromeTrigger::MergeFrom(const ChromeTrigger& from) {
282 ChromeTrigger* const _this = this;
283 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ChromeTrigger)
284 GOOGLE_DCHECK_NE(&from, _this);
285 ::uint32_t cached_has_bits = 0;
286 (void) cached_has_bits;
287
288 cached_has_bits = from._impl_._has_bits_[0];
289 if (cached_has_bits & 0x00000007u) {
290 if (cached_has_bits & 0x00000001u) {
291 _this->_internal_set_trigger_name(from._internal_trigger_name());
292 }
293 if (cached_has_bits & 0x00000002u) {
294 _this->_impl_.flow_id_ = from._impl_.flow_id_;
295 }
296 if (cached_has_bits & 0x00000004u) {
297 _this->_impl_.trigger_name_hash_ = from._impl_.trigger_name_hash_;
298 }
299 _this->_impl_._has_bits_[0] |= cached_has_bits;
300 }
301 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
302 }
303
CopyFrom(const ChromeTrigger & from)304 void ChromeTrigger::CopyFrom(const ChromeTrigger& from) {
305 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ChromeTrigger)
306 if (&from == this) return;
307 Clear();
308 MergeFrom(from);
309 }
310
IsInitialized() const311 bool ChromeTrigger::IsInitialized() const {
312 return true;
313 }
314
InternalSwap(ChromeTrigger * other)315 void ChromeTrigger::InternalSwap(ChromeTrigger* other) {
316 using std::swap;
317 auto* lhs_arena = GetArenaForAllocation();
318 auto* rhs_arena = other->GetArenaForAllocation();
319 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
320 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
321 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
322 &_impl_.trigger_name_, lhs_arena,
323 &other->_impl_.trigger_name_, rhs_arena
324 );
325 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
326 PROTOBUF_FIELD_OFFSET(ChromeTrigger, _impl_.trigger_name_hash_)
327 + sizeof(ChromeTrigger::_impl_.trigger_name_hash_) // NOLINT
328 - PROTOBUF_FIELD_OFFSET(ChromeTrigger, _impl_.flow_id_)>(
329 reinterpret_cast<char*>(&_impl_.flow_id_),
330 reinterpret_cast<char*>(&other->_impl_.flow_id_));
331 }
332
GetTypeName() const333 std::string ChromeTrigger::GetTypeName() const {
334 return "perfetto.protos.ChromeTrigger";
335 }
336
337
338 // @@protoc_insertion_point(namespace_scope)
339 } // namespace protos
340 } // namespace perfetto
341 PROTOBUF_NAMESPACE_OPEN
342 template<> PROTOBUF_NOINLINE ::perfetto::protos::ChromeTrigger*
CreateMaybeMessage(Arena * arena)343 Arena::CreateMaybeMessage< ::perfetto::protos::ChromeTrigger >(Arena* arena) {
344 return Arena::CreateMessageInternal< ::perfetto::protos::ChromeTrigger >(arena);
345 }
346 PROTOBUF_NAMESPACE_CLOSE
347
348 // @@protoc_insertion_point(global_scope)
349 #include <google/protobuf/port_undef.inc>
350