1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: ukm/report.proto
3
4 #include "ukm/report.pb.h"
5
6 #include <algorithm>
7
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
12 // @@protoc_insertion_point(includes)
13 #include <google/protobuf/port_def.inc>
14
15 PROTOBUF_PRAGMA_INIT_SEG
16
17 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
18 namespace _pbi = _pb::internal;
19
20 namespace ukm {
Report_SourceCounts(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR Report_SourceCounts::Report_SourceCounts(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.observed_)*/0
26 , /*decltype(_impl_.navigation_sources_)*/0
27 , /*decltype(_impl_.unmatched_sources_)*/0
28 , /*decltype(_impl_.carryover_sources_)*/0
29 , /*decltype(_impl_.deferred_sources_)*/0
30 , /*decltype(_impl_.entryless_sources_)*/0
31 , /*decltype(_impl_.pruned_sources_age_seconds_)*/0} {}
32 struct Report_SourceCountsDefaultTypeInternal {
Report_SourceCountsDefaultTypeInternalukm::Report_SourceCountsDefaultTypeInternal33 PROTOBUF_CONSTEXPR Report_SourceCountsDefaultTypeInternal()
34 : _instance(::_pbi::ConstantInitialized{}) {}
~Report_SourceCountsDefaultTypeInternalukm::Report_SourceCountsDefaultTypeInternal35 ~Report_SourceCountsDefaultTypeInternal() {}
36 union {
37 Report_SourceCounts _instance;
38 };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Report_SourceCountsDefaultTypeInternal _Report_SourceCounts_default_instance_;
Report(::_pbi::ConstantInitialized)41 PROTOBUF_CONSTEXPR Report::Report(
42 ::_pbi::ConstantInitialized): _impl_{
43 /*decltype(_impl_._has_bits_)*/{}
44 , /*decltype(_impl_._cached_size_)*/{}
45 , /*decltype(_impl_.sources_)*/{}
46 , /*decltype(_impl_.entries_)*/{}
47 , /*decltype(_impl_.aggregates_)*/{}
48 , /*decltype(_impl_.web_features_)*/{}
49 , /*decltype(_impl_.system_profile_)*/nullptr
50 , /*decltype(_impl_.source_counts_)*/nullptr
51 , /*decltype(_impl_.user_demographics_)*/nullptr
52 , /*decltype(_impl_.client_id_)*/uint64_t{0u}
53 , /*decltype(_impl_.session_id_)*/0
54 , /*decltype(_impl_.report_id_)*/0
55 , /*decltype(_impl_.is_continuous_)*/false
56 , /*decltype(_impl_.log_rotation_reason_)*/0
57 , /*decltype(_impl_.product_)*/0} {}
58 struct ReportDefaultTypeInternal {
ReportDefaultTypeInternalukm::ReportDefaultTypeInternal59 PROTOBUF_CONSTEXPR ReportDefaultTypeInternal()
60 : _instance(::_pbi::ConstantInitialized{}) {}
~ReportDefaultTypeInternalukm::ReportDefaultTypeInternal61 ~ReportDefaultTypeInternal() {}
62 union {
63 Report _instance;
64 };
65 };
66 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReportDefaultTypeInternal _Report_default_instance_;
67 } // namespace ukm
68 namespace ukm {
Report_LogRotationReason_IsValid(int value)69 bool Report_LogRotationReason_IsValid(int value) {
70 switch (value) {
71 case 0:
72 case 1:
73 case 2:
74 case 3:
75 return true;
76 default:
77 return false;
78 }
79 }
80
81 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> Report_LogRotationReason_strings[4] = {};
82
83 static const char Report_LogRotationReason_names[] =
84 "BACKGROUNDED"
85 "SCHEDULED_ROTATION"
86 "SHUTDOWN"
87 "UNKNOWN";
88
89 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Report_LogRotationReason_entries[] = {
90 { {Report_LogRotationReason_names + 0, 12}, 2 },
91 { {Report_LogRotationReason_names + 12, 18}, 1 },
92 { {Report_LogRotationReason_names + 30, 8}, 3 },
93 { {Report_LogRotationReason_names + 38, 7}, 0 },
94 };
95
96 static const int Report_LogRotationReason_entries_by_number[] = {
97 3, // 0 -> UNKNOWN
98 1, // 1 -> SCHEDULED_ROTATION
99 0, // 2 -> BACKGROUNDED
100 2, // 3 -> SHUTDOWN
101 };
102
Report_LogRotationReason_Name(Report_LogRotationReason value)103 const std::string& Report_LogRotationReason_Name(
104 Report_LogRotationReason value) {
105 static const bool dummy =
106 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
107 Report_LogRotationReason_entries,
108 Report_LogRotationReason_entries_by_number,
109 4, Report_LogRotationReason_strings);
110 (void) dummy;
111 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
112 Report_LogRotationReason_entries,
113 Report_LogRotationReason_entries_by_number,
114 4, value);
115 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
116 Report_LogRotationReason_strings[idx].get();
117 }
Report_LogRotationReason_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,Report_LogRotationReason * value)118 bool Report_LogRotationReason_Parse(
119 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Report_LogRotationReason* value) {
120 int int_value;
121 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
122 Report_LogRotationReason_entries, 4, name, &int_value);
123 if (success) {
124 *value = static_cast<Report_LogRotationReason>(int_value);
125 }
126 return success;
127 }
128 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
129 constexpr Report_LogRotationReason Report::UNKNOWN;
130 constexpr Report_LogRotationReason Report::SCHEDULED_ROTATION;
131 constexpr Report_LogRotationReason Report::BACKGROUNDED;
132 constexpr Report_LogRotationReason Report::SHUTDOWN;
133 constexpr Report_LogRotationReason Report::LogRotationReason_MIN;
134 constexpr Report_LogRotationReason Report::LogRotationReason_MAX;
135 constexpr int Report::LogRotationReason_ARRAYSIZE;
136 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
137
138 // ===================================================================
139
140 class Report_SourceCounts::_Internal {
141 public:
142 using HasBits = decltype(std::declval<Report_SourceCounts>()._impl_._has_bits_);
set_has_observed(HasBits * has_bits)143 static void set_has_observed(HasBits* has_bits) {
144 (*has_bits)[0] |= 1u;
145 }
set_has_navigation_sources(HasBits * has_bits)146 static void set_has_navigation_sources(HasBits* has_bits) {
147 (*has_bits)[0] |= 2u;
148 }
set_has_unmatched_sources(HasBits * has_bits)149 static void set_has_unmatched_sources(HasBits* has_bits) {
150 (*has_bits)[0] |= 4u;
151 }
set_has_carryover_sources(HasBits * has_bits)152 static void set_has_carryover_sources(HasBits* has_bits) {
153 (*has_bits)[0] |= 8u;
154 }
set_has_deferred_sources(HasBits * has_bits)155 static void set_has_deferred_sources(HasBits* has_bits) {
156 (*has_bits)[0] |= 16u;
157 }
set_has_entryless_sources(HasBits * has_bits)158 static void set_has_entryless_sources(HasBits* has_bits) {
159 (*has_bits)[0] |= 32u;
160 }
set_has_pruned_sources_age_seconds(HasBits * has_bits)161 static void set_has_pruned_sources_age_seconds(HasBits* has_bits) {
162 (*has_bits)[0] |= 64u;
163 }
164 };
165
Report_SourceCounts(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)166 Report_SourceCounts::Report_SourceCounts(::PROTOBUF_NAMESPACE_ID::Arena* arena,
167 bool is_message_owned)
168 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
169 SharedCtor(arena, is_message_owned);
170 // @@protoc_insertion_point(arena_constructor:ukm.Report.SourceCounts)
171 }
Report_SourceCounts(const Report_SourceCounts & from)172 Report_SourceCounts::Report_SourceCounts(const Report_SourceCounts& from)
173 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
174 Report_SourceCounts* const _this = this; (void)_this;
175 new (&_impl_) Impl_{
176 decltype(_impl_._has_bits_){from._impl_._has_bits_}
177 , /*decltype(_impl_._cached_size_)*/{}
178 , decltype(_impl_.observed_){}
179 , decltype(_impl_.navigation_sources_){}
180 , decltype(_impl_.unmatched_sources_){}
181 , decltype(_impl_.carryover_sources_){}
182 , decltype(_impl_.deferred_sources_){}
183 , decltype(_impl_.entryless_sources_){}
184 , decltype(_impl_.pruned_sources_age_seconds_){}};
185
186 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
187 ::memcpy(&_impl_.observed_, &from._impl_.observed_,
188 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.pruned_sources_age_seconds_) -
189 reinterpret_cast<char*>(&_impl_.observed_)) + sizeof(_impl_.pruned_sources_age_seconds_));
190 // @@protoc_insertion_point(copy_constructor:ukm.Report.SourceCounts)
191 }
192
SharedCtor(::_pb::Arena * arena,bool is_message_owned)193 inline void Report_SourceCounts::SharedCtor(
194 ::_pb::Arena* arena, bool is_message_owned) {
195 (void)arena;
196 (void)is_message_owned;
197 new (&_impl_) Impl_{
198 decltype(_impl_._has_bits_){}
199 , /*decltype(_impl_._cached_size_)*/{}
200 , decltype(_impl_.observed_){0}
201 , decltype(_impl_.navigation_sources_){0}
202 , decltype(_impl_.unmatched_sources_){0}
203 , decltype(_impl_.carryover_sources_){0}
204 , decltype(_impl_.deferred_sources_){0}
205 , decltype(_impl_.entryless_sources_){0}
206 , decltype(_impl_.pruned_sources_age_seconds_){0}
207 };
208 }
209
~Report_SourceCounts()210 Report_SourceCounts::~Report_SourceCounts() {
211 // @@protoc_insertion_point(destructor:ukm.Report.SourceCounts)
212 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
213 (void)arena;
214 return;
215 }
216 SharedDtor();
217 }
218
SharedDtor()219 inline void Report_SourceCounts::SharedDtor() {
220 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
221 }
222
SetCachedSize(int size) const223 void Report_SourceCounts::SetCachedSize(int size) const {
224 _impl_._cached_size_.Set(size);
225 }
226
Clear()227 void Report_SourceCounts::Clear() {
228 // @@protoc_insertion_point(message_clear_start:ukm.Report.SourceCounts)
229 uint32_t cached_has_bits = 0;
230 // Prevent compiler warnings about cached_has_bits being unused
231 (void) cached_has_bits;
232
233 cached_has_bits = _impl_._has_bits_[0];
234 if (cached_has_bits & 0x0000007fu) {
235 ::memset(&_impl_.observed_, 0, static_cast<size_t>(
236 reinterpret_cast<char*>(&_impl_.pruned_sources_age_seconds_) -
237 reinterpret_cast<char*>(&_impl_.observed_)) + sizeof(_impl_.pruned_sources_age_seconds_));
238 }
239 _impl_._has_bits_.Clear();
240 _internal_metadata_.Clear<std::string>();
241 }
242
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)243 const char* Report_SourceCounts::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
244 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
245 _Internal::HasBits has_bits{};
246 while (!ctx->Done(&ptr)) {
247 uint32_t tag;
248 ptr = ::_pbi::ReadTag(ptr, &tag);
249 switch (tag >> 3) {
250 // optional int32 observed = 1;
251 case 1:
252 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
253 _Internal::set_has_observed(&has_bits);
254 _impl_.observed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
255 CHK_(ptr);
256 } else
257 goto handle_unusual;
258 continue;
259 // optional int32 navigation_sources = 2;
260 case 2:
261 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
262 _Internal::set_has_navigation_sources(&has_bits);
263 _impl_.navigation_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
264 CHK_(ptr);
265 } else
266 goto handle_unusual;
267 continue;
268 // optional int32 unmatched_sources = 3;
269 case 3:
270 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
271 _Internal::set_has_unmatched_sources(&has_bits);
272 _impl_.unmatched_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
273 CHK_(ptr);
274 } else
275 goto handle_unusual;
276 continue;
277 // optional int32 carryover_sources = 4;
278 case 4:
279 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
280 _Internal::set_has_carryover_sources(&has_bits);
281 _impl_.carryover_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
282 CHK_(ptr);
283 } else
284 goto handle_unusual;
285 continue;
286 // optional int32 deferred_sources = 5;
287 case 5:
288 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
289 _Internal::set_has_deferred_sources(&has_bits);
290 _impl_.deferred_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
291 CHK_(ptr);
292 } else
293 goto handle_unusual;
294 continue;
295 // optional int32 entryless_sources = 6;
296 case 6:
297 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
298 _Internal::set_has_entryless_sources(&has_bits);
299 _impl_.entryless_sources_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
300 CHK_(ptr);
301 } else
302 goto handle_unusual;
303 continue;
304 // optional int32 pruned_sources_age_seconds = 7;
305 case 7:
306 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
307 _Internal::set_has_pruned_sources_age_seconds(&has_bits);
308 _impl_.pruned_sources_age_seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
309 CHK_(ptr);
310 } else
311 goto handle_unusual;
312 continue;
313 default:
314 goto handle_unusual;
315 } // switch
316 handle_unusual:
317 if ((tag == 0) || ((tag & 7) == 4)) {
318 CHK_(ptr);
319 ctx->SetLastTag(tag);
320 goto message_done;
321 }
322 ptr = UnknownFieldParse(
323 tag,
324 _internal_metadata_.mutable_unknown_fields<std::string>(),
325 ptr, ctx);
326 CHK_(ptr != nullptr);
327 } // while
328 message_done:
329 _impl_._has_bits_.Or(has_bits);
330 return ptr;
331 failure:
332 ptr = nullptr;
333 goto message_done;
334 #undef CHK_
335 }
336
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const337 uint8_t* Report_SourceCounts::_InternalSerialize(
338 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
339 // @@protoc_insertion_point(serialize_to_array_start:ukm.Report.SourceCounts)
340 uint32_t cached_has_bits = 0;
341 (void) cached_has_bits;
342
343 cached_has_bits = _impl_._has_bits_[0];
344 // optional int32 observed = 1;
345 if (cached_has_bits & 0x00000001u) {
346 target = stream->EnsureSpace(target);
347 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_observed(), target);
348 }
349
350 // optional int32 navigation_sources = 2;
351 if (cached_has_bits & 0x00000002u) {
352 target = stream->EnsureSpace(target);
353 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_navigation_sources(), target);
354 }
355
356 // optional int32 unmatched_sources = 3;
357 if (cached_has_bits & 0x00000004u) {
358 target = stream->EnsureSpace(target);
359 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_unmatched_sources(), target);
360 }
361
362 // optional int32 carryover_sources = 4;
363 if (cached_has_bits & 0x00000008u) {
364 target = stream->EnsureSpace(target);
365 target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_carryover_sources(), target);
366 }
367
368 // optional int32 deferred_sources = 5;
369 if (cached_has_bits & 0x00000010u) {
370 target = stream->EnsureSpace(target);
371 target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_deferred_sources(), target);
372 }
373
374 // optional int32 entryless_sources = 6;
375 if (cached_has_bits & 0x00000020u) {
376 target = stream->EnsureSpace(target);
377 target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_entryless_sources(), target);
378 }
379
380 // optional int32 pruned_sources_age_seconds = 7;
381 if (cached_has_bits & 0x00000040u) {
382 target = stream->EnsureSpace(target);
383 target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_pruned_sources_age_seconds(), target);
384 }
385
386 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
387 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
388 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
389 }
390 // @@protoc_insertion_point(serialize_to_array_end:ukm.Report.SourceCounts)
391 return target;
392 }
393
ByteSizeLong() const394 size_t Report_SourceCounts::ByteSizeLong() const {
395 // @@protoc_insertion_point(message_byte_size_start:ukm.Report.SourceCounts)
396 size_t total_size = 0;
397
398 uint32_t cached_has_bits = 0;
399 // Prevent compiler warnings about cached_has_bits being unused
400 (void) cached_has_bits;
401
402 cached_has_bits = _impl_._has_bits_[0];
403 if (cached_has_bits & 0x0000007fu) {
404 // optional int32 observed = 1;
405 if (cached_has_bits & 0x00000001u) {
406 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_observed());
407 }
408
409 // optional int32 navigation_sources = 2;
410 if (cached_has_bits & 0x00000002u) {
411 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_navigation_sources());
412 }
413
414 // optional int32 unmatched_sources = 3;
415 if (cached_has_bits & 0x00000004u) {
416 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_unmatched_sources());
417 }
418
419 // optional int32 carryover_sources = 4;
420 if (cached_has_bits & 0x00000008u) {
421 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_carryover_sources());
422 }
423
424 // optional int32 deferred_sources = 5;
425 if (cached_has_bits & 0x00000010u) {
426 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_deferred_sources());
427 }
428
429 // optional int32 entryless_sources = 6;
430 if (cached_has_bits & 0x00000020u) {
431 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_entryless_sources());
432 }
433
434 // optional int32 pruned_sources_age_seconds = 7;
435 if (cached_has_bits & 0x00000040u) {
436 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pruned_sources_age_seconds());
437 }
438
439 }
440 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
441 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
442 }
443 int cached_size = ::_pbi::ToCachedSize(total_size);
444 SetCachedSize(cached_size);
445 return total_size;
446 }
447
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)448 void Report_SourceCounts::CheckTypeAndMergeFrom(
449 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
450 MergeFrom(*::_pbi::DownCast<const Report_SourceCounts*>(
451 &from));
452 }
453
MergeFrom(const Report_SourceCounts & from)454 void Report_SourceCounts::MergeFrom(const Report_SourceCounts& from) {
455 Report_SourceCounts* const _this = this;
456 // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Report.SourceCounts)
457 GOOGLE_DCHECK_NE(&from, _this);
458 uint32_t cached_has_bits = 0;
459 (void) cached_has_bits;
460
461 cached_has_bits = from._impl_._has_bits_[0];
462 if (cached_has_bits & 0x0000007fu) {
463 if (cached_has_bits & 0x00000001u) {
464 _this->_impl_.observed_ = from._impl_.observed_;
465 }
466 if (cached_has_bits & 0x00000002u) {
467 _this->_impl_.navigation_sources_ = from._impl_.navigation_sources_;
468 }
469 if (cached_has_bits & 0x00000004u) {
470 _this->_impl_.unmatched_sources_ = from._impl_.unmatched_sources_;
471 }
472 if (cached_has_bits & 0x00000008u) {
473 _this->_impl_.carryover_sources_ = from._impl_.carryover_sources_;
474 }
475 if (cached_has_bits & 0x00000010u) {
476 _this->_impl_.deferred_sources_ = from._impl_.deferred_sources_;
477 }
478 if (cached_has_bits & 0x00000020u) {
479 _this->_impl_.entryless_sources_ = from._impl_.entryless_sources_;
480 }
481 if (cached_has_bits & 0x00000040u) {
482 _this->_impl_.pruned_sources_age_seconds_ = from._impl_.pruned_sources_age_seconds_;
483 }
484 _this->_impl_._has_bits_[0] |= cached_has_bits;
485 }
486 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
487 }
488
CopyFrom(const Report_SourceCounts & from)489 void Report_SourceCounts::CopyFrom(const Report_SourceCounts& from) {
490 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Report.SourceCounts)
491 if (&from == this) return;
492 Clear();
493 MergeFrom(from);
494 }
495
IsInitialized() const496 bool Report_SourceCounts::IsInitialized() const {
497 return true;
498 }
499
InternalSwap(Report_SourceCounts * other)500 void Report_SourceCounts::InternalSwap(Report_SourceCounts* other) {
501 using std::swap;
502 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
503 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
504 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
505 PROTOBUF_FIELD_OFFSET(Report_SourceCounts, _impl_.pruned_sources_age_seconds_)
506 + sizeof(Report_SourceCounts::_impl_.pruned_sources_age_seconds_)
507 - PROTOBUF_FIELD_OFFSET(Report_SourceCounts, _impl_.observed_)>(
508 reinterpret_cast<char*>(&_impl_.observed_),
509 reinterpret_cast<char*>(&other->_impl_.observed_));
510 }
511
GetTypeName() const512 std::string Report_SourceCounts::GetTypeName() const {
513 return "ukm.Report.SourceCounts";
514 }
515
516
517 // ===================================================================
518
519 class Report::_Internal {
520 public:
521 using HasBits = decltype(std::declval<Report>()._impl_._has_bits_);
set_has_client_id(HasBits * has_bits)522 static void set_has_client_id(HasBits* has_bits) {
523 (*has_bits)[0] |= 8u;
524 }
set_has_product(HasBits * has_bits)525 static void set_has_product(HasBits* has_bits) {
526 (*has_bits)[0] |= 256u;
527 }
set_has_session_id(HasBits * has_bits)528 static void set_has_session_id(HasBits* has_bits) {
529 (*has_bits)[0] |= 16u;
530 }
set_has_report_id(HasBits * has_bits)531 static void set_has_report_id(HasBits* has_bits) {
532 (*has_bits)[0] |= 32u;
533 }
set_has_is_continuous(HasBits * has_bits)534 static void set_has_is_continuous(HasBits* has_bits) {
535 (*has_bits)[0] |= 64u;
536 }
set_has_log_rotation_reason(HasBits * has_bits)537 static void set_has_log_rotation_reason(HasBits* has_bits) {
538 (*has_bits)[0] |= 128u;
539 }
540 static const ::metrics::SystemProfileProto& system_profile(const Report* msg);
set_has_system_profile(HasBits * has_bits)541 static void set_has_system_profile(HasBits* has_bits) {
542 (*has_bits)[0] |= 1u;
543 }
544 static const ::metrics::UserDemographicsProto& user_demographics(const Report* msg);
set_has_user_demographics(HasBits * has_bits)545 static void set_has_user_demographics(HasBits* has_bits) {
546 (*has_bits)[0] |= 4u;
547 }
548 static const ::ukm::Report_SourceCounts& source_counts(const Report* msg);
set_has_source_counts(HasBits * has_bits)549 static void set_has_source_counts(HasBits* has_bits) {
550 (*has_bits)[0] |= 2u;
551 }
552 };
553
554 const ::metrics::SystemProfileProto&
system_profile(const Report * msg)555 Report::_Internal::system_profile(const Report* msg) {
556 return *msg->_impl_.system_profile_;
557 }
558 const ::metrics::UserDemographicsProto&
user_demographics(const Report * msg)559 Report::_Internal::user_demographics(const Report* msg) {
560 return *msg->_impl_.user_demographics_;
561 }
562 const ::ukm::Report_SourceCounts&
source_counts(const Report * msg)563 Report::_Internal::source_counts(const Report* msg) {
564 return *msg->_impl_.source_counts_;
565 }
clear_system_profile()566 void Report::clear_system_profile() {
567 if (_impl_.system_profile_ != nullptr) _impl_.system_profile_->Clear();
568 _impl_._has_bits_[0] &= ~0x00000001u;
569 }
clear_user_demographics()570 void Report::clear_user_demographics() {
571 if (_impl_.user_demographics_ != nullptr) _impl_.user_demographics_->Clear();
572 _impl_._has_bits_[0] &= ~0x00000004u;
573 }
clear_sources()574 void Report::clear_sources() {
575 _impl_.sources_.Clear();
576 }
clear_entries()577 void Report::clear_entries() {
578 _impl_.entries_.Clear();
579 }
clear_web_features()580 void Report::clear_web_features() {
581 _impl_.web_features_.Clear();
582 }
clear_aggregates()583 void Report::clear_aggregates() {
584 _impl_.aggregates_.Clear();
585 }
Report(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)586 Report::Report(::PROTOBUF_NAMESPACE_ID::Arena* arena,
587 bool is_message_owned)
588 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
589 SharedCtor(arena, is_message_owned);
590 // @@protoc_insertion_point(arena_constructor:ukm.Report)
591 }
Report(const Report & from)592 Report::Report(const Report& from)
593 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
594 Report* const _this = this; (void)_this;
595 new (&_impl_) Impl_{
596 decltype(_impl_._has_bits_){from._impl_._has_bits_}
597 , /*decltype(_impl_._cached_size_)*/{}
598 , decltype(_impl_.sources_){from._impl_.sources_}
599 , decltype(_impl_.entries_){from._impl_.entries_}
600 , decltype(_impl_.aggregates_){from._impl_.aggregates_}
601 , decltype(_impl_.web_features_){from._impl_.web_features_}
602 , decltype(_impl_.system_profile_){nullptr}
603 , decltype(_impl_.source_counts_){nullptr}
604 , decltype(_impl_.user_demographics_){nullptr}
605 , decltype(_impl_.client_id_){}
606 , decltype(_impl_.session_id_){}
607 , decltype(_impl_.report_id_){}
608 , decltype(_impl_.is_continuous_){}
609 , decltype(_impl_.log_rotation_reason_){}
610 , decltype(_impl_.product_){}};
611
612 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
613 if (from._internal_has_system_profile()) {
614 _this->_impl_.system_profile_ = new ::metrics::SystemProfileProto(*from._impl_.system_profile_);
615 }
616 if (from._internal_has_source_counts()) {
617 _this->_impl_.source_counts_ = new ::ukm::Report_SourceCounts(*from._impl_.source_counts_);
618 }
619 if (from._internal_has_user_demographics()) {
620 _this->_impl_.user_demographics_ = new ::metrics::UserDemographicsProto(*from._impl_.user_demographics_);
621 }
622 ::memcpy(&_impl_.client_id_, &from._impl_.client_id_,
623 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.product_) -
624 reinterpret_cast<char*>(&_impl_.client_id_)) + sizeof(_impl_.product_));
625 // @@protoc_insertion_point(copy_constructor:ukm.Report)
626 }
627
SharedCtor(::_pb::Arena * arena,bool is_message_owned)628 inline void Report::SharedCtor(
629 ::_pb::Arena* arena, bool is_message_owned) {
630 (void)arena;
631 (void)is_message_owned;
632 new (&_impl_) Impl_{
633 decltype(_impl_._has_bits_){}
634 , /*decltype(_impl_._cached_size_)*/{}
635 , decltype(_impl_.sources_){arena}
636 , decltype(_impl_.entries_){arena}
637 , decltype(_impl_.aggregates_){arena}
638 , decltype(_impl_.web_features_){arena}
639 , decltype(_impl_.system_profile_){nullptr}
640 , decltype(_impl_.source_counts_){nullptr}
641 , decltype(_impl_.user_demographics_){nullptr}
642 , decltype(_impl_.client_id_){uint64_t{0u}}
643 , decltype(_impl_.session_id_){0}
644 , decltype(_impl_.report_id_){0}
645 , decltype(_impl_.is_continuous_){false}
646 , decltype(_impl_.log_rotation_reason_){0}
647 , decltype(_impl_.product_){0}
648 };
649 }
650
~Report()651 Report::~Report() {
652 // @@protoc_insertion_point(destructor:ukm.Report)
653 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
654 (void)arena;
655 return;
656 }
657 SharedDtor();
658 }
659
SharedDtor()660 inline void Report::SharedDtor() {
661 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
662 _impl_.sources_.~RepeatedPtrField();
663 _impl_.entries_.~RepeatedPtrField();
664 _impl_.aggregates_.~RepeatedPtrField();
665 _impl_.web_features_.~RepeatedPtrField();
666 if (this != internal_default_instance()) delete _impl_.system_profile_;
667 if (this != internal_default_instance()) delete _impl_.source_counts_;
668 if (this != internal_default_instance()) delete _impl_.user_demographics_;
669 }
670
SetCachedSize(int size) const671 void Report::SetCachedSize(int size) const {
672 _impl_._cached_size_.Set(size);
673 }
674
Clear()675 void Report::Clear() {
676 // @@protoc_insertion_point(message_clear_start:ukm.Report)
677 uint32_t cached_has_bits = 0;
678 // Prevent compiler warnings about cached_has_bits being unused
679 (void) cached_has_bits;
680
681 _impl_.sources_.Clear();
682 _impl_.entries_.Clear();
683 _impl_.aggregates_.Clear();
684 _impl_.web_features_.Clear();
685 cached_has_bits = _impl_._has_bits_[0];
686 if (cached_has_bits & 0x00000007u) {
687 if (cached_has_bits & 0x00000001u) {
688 GOOGLE_DCHECK(_impl_.system_profile_ != nullptr);
689 _impl_.system_profile_->Clear();
690 }
691 if (cached_has_bits & 0x00000002u) {
692 GOOGLE_DCHECK(_impl_.source_counts_ != nullptr);
693 _impl_.source_counts_->Clear();
694 }
695 if (cached_has_bits & 0x00000004u) {
696 GOOGLE_DCHECK(_impl_.user_demographics_ != nullptr);
697 _impl_.user_demographics_->Clear();
698 }
699 }
700 if (cached_has_bits & 0x000000f8u) {
701 ::memset(&_impl_.client_id_, 0, static_cast<size_t>(
702 reinterpret_cast<char*>(&_impl_.log_rotation_reason_) -
703 reinterpret_cast<char*>(&_impl_.client_id_)) + sizeof(_impl_.log_rotation_reason_));
704 }
705 _impl_.product_ = 0;
706 _impl_._has_bits_.Clear();
707 _internal_metadata_.Clear<std::string>();
708 }
709
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)710 const char* Report::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
711 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
712 _Internal::HasBits has_bits{};
713 while (!ctx->Done(&ptr)) {
714 uint32_t tag;
715 ptr = ::_pbi::ReadTag(ptr, &tag);
716 switch (tag >> 3) {
717 // optional fixed64 client_id = 1;
718 case 1:
719 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 9)) {
720 _Internal::set_has_client_id(&has_bits);
721 _impl_.client_id_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<uint64_t>(ptr);
722 ptr += sizeof(uint64_t);
723 } else
724 goto handle_unusual;
725 continue;
726 // optional .metrics.SystemProfileProto system_profile = 2;
727 case 2:
728 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
729 ptr = ctx->ParseMessage(_internal_mutable_system_profile(), ptr);
730 CHK_(ptr);
731 } else
732 goto handle_unusual;
733 continue;
734 // repeated .ukm.Source sources = 3;
735 case 3:
736 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
737 ptr -= 1;
738 do {
739 ptr += 1;
740 ptr = ctx->ParseMessage(_internal_add_sources(), ptr);
741 CHK_(ptr);
742 if (!ctx->DataAvailable(ptr)) break;
743 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
744 } else
745 goto handle_unusual;
746 continue;
747 // repeated .ukm.Entry entries = 4;
748 case 4:
749 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
750 ptr -= 1;
751 do {
752 ptr += 1;
753 ptr = ctx->ParseMessage(_internal_add_entries(), ptr);
754 CHK_(ptr);
755 if (!ctx->DataAvailable(ptr)) break;
756 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
757 } else
758 goto handle_unusual;
759 continue;
760 // optional int32 session_id = 5;
761 case 5:
762 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
763 _Internal::set_has_session_id(&has_bits);
764 _impl_.session_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
765 CHK_(ptr);
766 } else
767 goto handle_unusual;
768 continue;
769 // optional int32 report_id = 6;
770 case 6:
771 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
772 _Internal::set_has_report_id(&has_bits);
773 _impl_.report_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
774 CHK_(ptr);
775 } else
776 goto handle_unusual;
777 continue;
778 // repeated .ukm.Aggregate aggregates = 7;
779 case 7:
780 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
781 ptr -= 1;
782 do {
783 ptr += 1;
784 ptr = ctx->ParseMessage(_internal_add_aggregates(), ptr);
785 CHK_(ptr);
786 if (!ctx->DataAvailable(ptr)) break;
787 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
788 } else
789 goto handle_unusual;
790 continue;
791 // optional bool is_continuous = 8;
792 case 8:
793 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
794 _Internal::set_has_is_continuous(&has_bits);
795 _impl_.is_continuous_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
796 CHK_(ptr);
797 } else
798 goto handle_unusual;
799 continue;
800 // optional .ukm.Report.LogRotationReason log_rotation_reason = 9;
801 case 9:
802 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
803 uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
804 CHK_(ptr);
805 if (PROTOBUF_PREDICT_TRUE(::ukm::Report_LogRotationReason_IsValid(val))) {
806 _internal_set_log_rotation_reason(static_cast<::ukm::Report_LogRotationReason>(val));
807 } else {
808 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
809 }
810 } else
811 goto handle_unusual;
812 continue;
813 // optional .ukm.Report.SourceCounts source_counts = 10;
814 case 10:
815 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
816 ptr = ctx->ParseMessage(_internal_mutable_source_counts(), ptr);
817 CHK_(ptr);
818 } else
819 goto handle_unusual;
820 continue;
821 // optional .metrics.UserDemographicsProto user_demographics = 11;
822 case 11:
823 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
824 ptr = ctx->ParseMessage(_internal_mutable_user_demographics(), ptr);
825 CHK_(ptr);
826 } else
827 goto handle_unusual;
828 continue;
829 // optional .metrics.ChromeUserMetricsExtension.Product product = 12 [default = CHROME];
830 case 12:
831 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
832 uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
833 CHK_(ptr);
834 if (PROTOBUF_PREDICT_TRUE(::metrics::ChromeUserMetricsExtension_Product_IsValid(val))) {
835 _internal_set_product(static_cast<::metrics::ChromeUserMetricsExtension_Product>(val));
836 } else {
837 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(12, val, mutable_unknown_fields());
838 }
839 } else
840 goto handle_unusual;
841 continue;
842 // repeated .ukm.HighLevelWebFeatures web_features = 13;
843 case 13:
844 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
845 ptr -= 1;
846 do {
847 ptr += 1;
848 ptr = ctx->ParseMessage(_internal_add_web_features(), ptr);
849 CHK_(ptr);
850 if (!ctx->DataAvailable(ptr)) break;
851 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<106>(ptr));
852 } else
853 goto handle_unusual;
854 continue;
855 default:
856 goto handle_unusual;
857 } // switch
858 handle_unusual:
859 if ((tag == 0) || ((tag & 7) == 4)) {
860 CHK_(ptr);
861 ctx->SetLastTag(tag);
862 goto message_done;
863 }
864 ptr = UnknownFieldParse(
865 tag,
866 _internal_metadata_.mutable_unknown_fields<std::string>(),
867 ptr, ctx);
868 CHK_(ptr != nullptr);
869 } // while
870 message_done:
871 _impl_._has_bits_.Or(has_bits);
872 return ptr;
873 failure:
874 ptr = nullptr;
875 goto message_done;
876 #undef CHK_
877 }
878
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const879 uint8_t* Report::_InternalSerialize(
880 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
881 // @@protoc_insertion_point(serialize_to_array_start:ukm.Report)
882 uint32_t cached_has_bits = 0;
883 (void) cached_has_bits;
884
885 cached_has_bits = _impl_._has_bits_[0];
886 // optional fixed64 client_id = 1;
887 if (cached_has_bits & 0x00000008u) {
888 target = stream->EnsureSpace(target);
889 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(1, this->_internal_client_id(), target);
890 }
891
892 // optional .metrics.SystemProfileProto system_profile = 2;
893 if (cached_has_bits & 0x00000001u) {
894 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
895 InternalWriteMessage(2, _Internal::system_profile(this),
896 _Internal::system_profile(this).GetCachedSize(), target, stream);
897 }
898
899 // repeated .ukm.Source sources = 3;
900 for (unsigned i = 0,
901 n = static_cast<unsigned>(this->_internal_sources_size()); i < n; i++) {
902 const auto& repfield = this->_internal_sources(i);
903 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
904 InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream);
905 }
906
907 // repeated .ukm.Entry entries = 4;
908 for (unsigned i = 0,
909 n = static_cast<unsigned>(this->_internal_entries_size()); i < n; i++) {
910 const auto& repfield = this->_internal_entries(i);
911 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
912 InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
913 }
914
915 // optional int32 session_id = 5;
916 if (cached_has_bits & 0x00000010u) {
917 target = stream->EnsureSpace(target);
918 target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_session_id(), target);
919 }
920
921 // optional int32 report_id = 6;
922 if (cached_has_bits & 0x00000020u) {
923 target = stream->EnsureSpace(target);
924 target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_report_id(), target);
925 }
926
927 // repeated .ukm.Aggregate aggregates = 7;
928 for (unsigned i = 0,
929 n = static_cast<unsigned>(this->_internal_aggregates_size()); i < n; i++) {
930 const auto& repfield = this->_internal_aggregates(i);
931 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
932 InternalWriteMessage(7, repfield, repfield.GetCachedSize(), target, stream);
933 }
934
935 // optional bool is_continuous = 8;
936 if (cached_has_bits & 0x00000040u) {
937 target = stream->EnsureSpace(target);
938 target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_is_continuous(), target);
939 }
940
941 // optional .ukm.Report.LogRotationReason log_rotation_reason = 9;
942 if (cached_has_bits & 0x00000080u) {
943 target = stream->EnsureSpace(target);
944 target = ::_pbi::WireFormatLite::WriteEnumToArray(
945 9, this->_internal_log_rotation_reason(), target);
946 }
947
948 // optional .ukm.Report.SourceCounts source_counts = 10;
949 if (cached_has_bits & 0x00000002u) {
950 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
951 InternalWriteMessage(10, _Internal::source_counts(this),
952 _Internal::source_counts(this).GetCachedSize(), target, stream);
953 }
954
955 // optional .metrics.UserDemographicsProto user_demographics = 11;
956 if (cached_has_bits & 0x00000004u) {
957 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
958 InternalWriteMessage(11, _Internal::user_demographics(this),
959 _Internal::user_demographics(this).GetCachedSize(), target, stream);
960 }
961
962 // optional .metrics.ChromeUserMetricsExtension.Product product = 12 [default = CHROME];
963 if (cached_has_bits & 0x00000100u) {
964 target = stream->EnsureSpace(target);
965 target = ::_pbi::WireFormatLite::WriteEnumToArray(
966 12, this->_internal_product(), target);
967 }
968
969 // repeated .ukm.HighLevelWebFeatures web_features = 13;
970 for (unsigned i = 0,
971 n = static_cast<unsigned>(this->_internal_web_features_size()); i < n; i++) {
972 const auto& repfield = this->_internal_web_features(i);
973 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
974 InternalWriteMessage(13, repfield, repfield.GetCachedSize(), target, stream);
975 }
976
977 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
978 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
979 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
980 }
981 // @@protoc_insertion_point(serialize_to_array_end:ukm.Report)
982 return target;
983 }
984
ByteSizeLong() const985 size_t Report::ByteSizeLong() const {
986 // @@protoc_insertion_point(message_byte_size_start:ukm.Report)
987 size_t total_size = 0;
988
989 uint32_t cached_has_bits = 0;
990 // Prevent compiler warnings about cached_has_bits being unused
991 (void) cached_has_bits;
992
993 // repeated .ukm.Source sources = 3;
994 total_size += 1UL * this->_internal_sources_size();
995 for (const auto& msg : this->_impl_.sources_) {
996 total_size +=
997 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
998 }
999
1000 // repeated .ukm.Entry entries = 4;
1001 total_size += 1UL * this->_internal_entries_size();
1002 for (const auto& msg : this->_impl_.entries_) {
1003 total_size +=
1004 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1005 }
1006
1007 // repeated .ukm.Aggregate aggregates = 7;
1008 total_size += 1UL * this->_internal_aggregates_size();
1009 for (const auto& msg : this->_impl_.aggregates_) {
1010 total_size +=
1011 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1012 }
1013
1014 // repeated .ukm.HighLevelWebFeatures web_features = 13;
1015 total_size += 1UL * this->_internal_web_features_size();
1016 for (const auto& msg : this->_impl_.web_features_) {
1017 total_size +=
1018 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1019 }
1020
1021 cached_has_bits = _impl_._has_bits_[0];
1022 if (cached_has_bits & 0x000000ffu) {
1023 // optional .metrics.SystemProfileProto system_profile = 2;
1024 if (cached_has_bits & 0x00000001u) {
1025 total_size += 1 +
1026 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1027 *_impl_.system_profile_);
1028 }
1029
1030 // optional .ukm.Report.SourceCounts source_counts = 10;
1031 if (cached_has_bits & 0x00000002u) {
1032 total_size += 1 +
1033 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1034 *_impl_.source_counts_);
1035 }
1036
1037 // optional .metrics.UserDemographicsProto user_demographics = 11;
1038 if (cached_has_bits & 0x00000004u) {
1039 total_size += 1 +
1040 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1041 *_impl_.user_demographics_);
1042 }
1043
1044 // optional fixed64 client_id = 1;
1045 if (cached_has_bits & 0x00000008u) {
1046 total_size += 1 + 8;
1047 }
1048
1049 // optional int32 session_id = 5;
1050 if (cached_has_bits & 0x00000010u) {
1051 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_session_id());
1052 }
1053
1054 // optional int32 report_id = 6;
1055 if (cached_has_bits & 0x00000020u) {
1056 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_report_id());
1057 }
1058
1059 // optional bool is_continuous = 8;
1060 if (cached_has_bits & 0x00000040u) {
1061 total_size += 1 + 1;
1062 }
1063
1064 // optional .ukm.Report.LogRotationReason log_rotation_reason = 9;
1065 if (cached_has_bits & 0x00000080u) {
1066 total_size += 1 +
1067 ::_pbi::WireFormatLite::EnumSize(this->_internal_log_rotation_reason());
1068 }
1069
1070 }
1071 // optional .metrics.ChromeUserMetricsExtension.Product product = 12 [default = CHROME];
1072 if (cached_has_bits & 0x00000100u) {
1073 total_size += 1 +
1074 ::_pbi::WireFormatLite::EnumSize(this->_internal_product());
1075 }
1076
1077 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1078 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1079 }
1080 int cached_size = ::_pbi::ToCachedSize(total_size);
1081 SetCachedSize(cached_size);
1082 return total_size;
1083 }
1084
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1085 void Report::CheckTypeAndMergeFrom(
1086 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1087 MergeFrom(*::_pbi::DownCast<const Report*>(
1088 &from));
1089 }
1090
MergeFrom(const Report & from)1091 void Report::MergeFrom(const Report& from) {
1092 Report* const _this = this;
1093 // @@protoc_insertion_point(class_specific_merge_from_start:ukm.Report)
1094 GOOGLE_DCHECK_NE(&from, _this);
1095 uint32_t cached_has_bits = 0;
1096 (void) cached_has_bits;
1097
1098 _this->_impl_.sources_.MergeFrom(from._impl_.sources_);
1099 _this->_impl_.entries_.MergeFrom(from._impl_.entries_);
1100 _this->_impl_.aggregates_.MergeFrom(from._impl_.aggregates_);
1101 _this->_impl_.web_features_.MergeFrom(from._impl_.web_features_);
1102 cached_has_bits = from._impl_._has_bits_[0];
1103 if (cached_has_bits & 0x000000ffu) {
1104 if (cached_has_bits & 0x00000001u) {
1105 _this->_internal_mutable_system_profile()->::metrics::SystemProfileProto::MergeFrom(
1106 from._internal_system_profile());
1107 }
1108 if (cached_has_bits & 0x00000002u) {
1109 _this->_internal_mutable_source_counts()->::ukm::Report_SourceCounts::MergeFrom(
1110 from._internal_source_counts());
1111 }
1112 if (cached_has_bits & 0x00000004u) {
1113 _this->_internal_mutable_user_demographics()->::metrics::UserDemographicsProto::MergeFrom(
1114 from._internal_user_demographics());
1115 }
1116 if (cached_has_bits & 0x00000008u) {
1117 _this->_impl_.client_id_ = from._impl_.client_id_;
1118 }
1119 if (cached_has_bits & 0x00000010u) {
1120 _this->_impl_.session_id_ = from._impl_.session_id_;
1121 }
1122 if (cached_has_bits & 0x00000020u) {
1123 _this->_impl_.report_id_ = from._impl_.report_id_;
1124 }
1125 if (cached_has_bits & 0x00000040u) {
1126 _this->_impl_.is_continuous_ = from._impl_.is_continuous_;
1127 }
1128 if (cached_has_bits & 0x00000080u) {
1129 _this->_impl_.log_rotation_reason_ = from._impl_.log_rotation_reason_;
1130 }
1131 _this->_impl_._has_bits_[0] |= cached_has_bits;
1132 }
1133 if (cached_has_bits & 0x00000100u) {
1134 _this->_internal_set_product(from._internal_product());
1135 }
1136 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1137 }
1138
CopyFrom(const Report & from)1139 void Report::CopyFrom(const Report& from) {
1140 // @@protoc_insertion_point(class_specific_copy_from_start:ukm.Report)
1141 if (&from == this) return;
1142 Clear();
1143 MergeFrom(from);
1144 }
1145
IsInitialized() const1146 bool Report::IsInitialized() const {
1147 return true;
1148 }
1149
InternalSwap(Report * other)1150 void Report::InternalSwap(Report* other) {
1151 using std::swap;
1152 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1153 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1154 _impl_.sources_.InternalSwap(&other->_impl_.sources_);
1155 _impl_.entries_.InternalSwap(&other->_impl_.entries_);
1156 _impl_.aggregates_.InternalSwap(&other->_impl_.aggregates_);
1157 _impl_.web_features_.InternalSwap(&other->_impl_.web_features_);
1158 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1159 PROTOBUF_FIELD_OFFSET(Report, _impl_.product_)
1160 + sizeof(Report::_impl_.product_)
1161 - PROTOBUF_FIELD_OFFSET(Report, _impl_.system_profile_)>(
1162 reinterpret_cast<char*>(&_impl_.system_profile_),
1163 reinterpret_cast<char*>(&other->_impl_.system_profile_));
1164 }
1165
GetTypeName() const1166 std::string Report::GetTypeName() const {
1167 return "ukm.Report";
1168 }
1169
1170
1171 // @@protoc_insertion_point(namespace_scope)
1172 } // namespace ukm
1173 PROTOBUF_NAMESPACE_OPEN
1174 template<> PROTOBUF_NOINLINE ::ukm::Report_SourceCounts*
CreateMaybeMessage(Arena * arena)1175 Arena::CreateMaybeMessage< ::ukm::Report_SourceCounts >(Arena* arena) {
1176 return Arena::CreateMessageInternal< ::ukm::Report_SourceCounts >(arena);
1177 }
1178 template<> PROTOBUF_NOINLINE ::ukm::Report*
CreateMaybeMessage(Arena * arena)1179 Arena::CreateMaybeMessage< ::ukm::Report >(Arena* arena) {
1180 return Arena::CreateMessageInternal< ::ukm::Report >(arena);
1181 }
1182 PROTOBUF_NAMESPACE_CLOSE
1183
1184 // @@protoc_insertion_point(global_scope)
1185 #include <google/protobuf/port_undef.inc>
1186