1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: quiche/quic/core/proto/cached_network_parameters.proto
3
4 #include "quiche/quic/core/proto/cached_network_parameters.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 quic {
CachedNetworkParameters(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR CachedNetworkParameters::CachedNetworkParameters(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.serving_region_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.bandwidth_estimate_bytes_per_second_)*/0
27 , /*decltype(_impl_.min_rtt_ms_)*/0
28 , /*decltype(_impl_.previous_connection_state_)*/0
29 , /*decltype(_impl_.max_bandwidth_estimate_bytes_per_second_)*/0
30 , /*decltype(_impl_.max_bandwidth_timestamp_seconds_)*/int64_t{0}
31 , /*decltype(_impl_.timestamp_)*/int64_t{0}} {}
32 struct CachedNetworkParametersDefaultTypeInternal {
CachedNetworkParametersDefaultTypeInternalquic::CachedNetworkParametersDefaultTypeInternal33 PROTOBUF_CONSTEXPR CachedNetworkParametersDefaultTypeInternal()
34 : _instance(::_pbi::ConstantInitialized{}) {}
~CachedNetworkParametersDefaultTypeInternalquic::CachedNetworkParametersDefaultTypeInternal35 ~CachedNetworkParametersDefaultTypeInternal() {}
36 union {
37 CachedNetworkParameters _instance;
38 };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CachedNetworkParametersDefaultTypeInternal _CachedNetworkParameters_default_instance_;
41 } // namespace quic
42 namespace quic {
CachedNetworkParameters_PreviousConnectionState_IsValid(int value)43 bool CachedNetworkParameters_PreviousConnectionState_IsValid(int value) {
44 switch (value) {
45 case 0:
46 case 1:
47 return true;
48 default:
49 return false;
50 }
51 }
52
53 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> CachedNetworkParameters_PreviousConnectionState_strings[2] = {};
54
55 static const char CachedNetworkParameters_PreviousConnectionState_names[] =
56 "CONGESTION_AVOIDANCE"
57 "SLOW_START";
58
59 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry CachedNetworkParameters_PreviousConnectionState_entries[] = {
60 { {CachedNetworkParameters_PreviousConnectionState_names + 0, 20}, 1 },
61 { {CachedNetworkParameters_PreviousConnectionState_names + 20, 10}, 0 },
62 };
63
64 static const int CachedNetworkParameters_PreviousConnectionState_entries_by_number[] = {
65 1, // 0 -> SLOW_START
66 0, // 1 -> CONGESTION_AVOIDANCE
67 };
68
CachedNetworkParameters_PreviousConnectionState_Name(CachedNetworkParameters_PreviousConnectionState value)69 const std::string& CachedNetworkParameters_PreviousConnectionState_Name(
70 CachedNetworkParameters_PreviousConnectionState value) {
71 static const bool dummy =
72 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
73 CachedNetworkParameters_PreviousConnectionState_entries,
74 CachedNetworkParameters_PreviousConnectionState_entries_by_number,
75 2, CachedNetworkParameters_PreviousConnectionState_strings);
76 (void) dummy;
77 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
78 CachedNetworkParameters_PreviousConnectionState_entries,
79 CachedNetworkParameters_PreviousConnectionState_entries_by_number,
80 2, value);
81 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
82 CachedNetworkParameters_PreviousConnectionState_strings[idx].get();
83 }
CachedNetworkParameters_PreviousConnectionState_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,CachedNetworkParameters_PreviousConnectionState * value)84 bool CachedNetworkParameters_PreviousConnectionState_Parse(
85 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, CachedNetworkParameters_PreviousConnectionState* value) {
86 int int_value;
87 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
88 CachedNetworkParameters_PreviousConnectionState_entries, 2, name, &int_value);
89 if (success) {
90 *value = static_cast<CachedNetworkParameters_PreviousConnectionState>(int_value);
91 }
92 return success;
93 }
94 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
95 constexpr CachedNetworkParameters_PreviousConnectionState CachedNetworkParameters::SLOW_START;
96 constexpr CachedNetworkParameters_PreviousConnectionState CachedNetworkParameters::CONGESTION_AVOIDANCE;
97 constexpr CachedNetworkParameters_PreviousConnectionState CachedNetworkParameters::PreviousConnectionState_MIN;
98 constexpr CachedNetworkParameters_PreviousConnectionState CachedNetworkParameters::PreviousConnectionState_MAX;
99 constexpr int CachedNetworkParameters::PreviousConnectionState_ARRAYSIZE;
100 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
101
102 // ===================================================================
103
104 class CachedNetworkParameters::_Internal {
105 public:
106 using HasBits = decltype(std::declval<CachedNetworkParameters>()._impl_._has_bits_);
set_has_serving_region(HasBits * has_bits)107 static void set_has_serving_region(HasBits* has_bits) {
108 (*has_bits)[0] |= 1u;
109 }
set_has_bandwidth_estimate_bytes_per_second(HasBits * has_bits)110 static void set_has_bandwidth_estimate_bytes_per_second(HasBits* has_bits) {
111 (*has_bits)[0] |= 2u;
112 }
set_has_max_bandwidth_estimate_bytes_per_second(HasBits * has_bits)113 static void set_has_max_bandwidth_estimate_bytes_per_second(HasBits* has_bits) {
114 (*has_bits)[0] |= 16u;
115 }
set_has_max_bandwidth_timestamp_seconds(HasBits * has_bits)116 static void set_has_max_bandwidth_timestamp_seconds(HasBits* has_bits) {
117 (*has_bits)[0] |= 32u;
118 }
set_has_min_rtt_ms(HasBits * has_bits)119 static void set_has_min_rtt_ms(HasBits* has_bits) {
120 (*has_bits)[0] |= 4u;
121 }
set_has_previous_connection_state(HasBits * has_bits)122 static void set_has_previous_connection_state(HasBits* has_bits) {
123 (*has_bits)[0] |= 8u;
124 }
set_has_timestamp(HasBits * has_bits)125 static void set_has_timestamp(HasBits* has_bits) {
126 (*has_bits)[0] |= 64u;
127 }
128 };
129
CachedNetworkParameters(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)130 CachedNetworkParameters::CachedNetworkParameters(::PROTOBUF_NAMESPACE_ID::Arena* arena,
131 bool is_message_owned)
132 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
133 SharedCtor(arena, is_message_owned);
134 // @@protoc_insertion_point(arena_constructor:quic.CachedNetworkParameters)
135 }
CachedNetworkParameters(const CachedNetworkParameters & from)136 CachedNetworkParameters::CachedNetworkParameters(const CachedNetworkParameters& from)
137 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
138 CachedNetworkParameters* const _this = this; (void)_this;
139 new (&_impl_) Impl_{
140 decltype(_impl_._has_bits_){from._impl_._has_bits_}
141 , /*decltype(_impl_._cached_size_)*/{}
142 , decltype(_impl_.serving_region_){}
143 , decltype(_impl_.bandwidth_estimate_bytes_per_second_){}
144 , decltype(_impl_.min_rtt_ms_){}
145 , decltype(_impl_.previous_connection_state_){}
146 , decltype(_impl_.max_bandwidth_estimate_bytes_per_second_){}
147 , decltype(_impl_.max_bandwidth_timestamp_seconds_){}
148 , decltype(_impl_.timestamp_){}};
149
150 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
151 _impl_.serving_region_.InitDefault();
152 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
153 _impl_.serving_region_.Set("", GetArenaForAllocation());
154 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
155 if (from._internal_has_serving_region()) {
156 _this->_impl_.serving_region_.Set(from._internal_serving_region(),
157 _this->GetArenaForAllocation());
158 }
159 ::memcpy(&_impl_.bandwidth_estimate_bytes_per_second_, &from._impl_.bandwidth_estimate_bytes_per_second_,
160 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.timestamp_) -
161 reinterpret_cast<char*>(&_impl_.bandwidth_estimate_bytes_per_second_)) + sizeof(_impl_.timestamp_));
162 // @@protoc_insertion_point(copy_constructor:quic.CachedNetworkParameters)
163 }
164
SharedCtor(::_pb::Arena * arena,bool is_message_owned)165 inline void CachedNetworkParameters::SharedCtor(
166 ::_pb::Arena* arena, bool is_message_owned) {
167 (void)arena;
168 (void)is_message_owned;
169 new (&_impl_) Impl_{
170 decltype(_impl_._has_bits_){}
171 , /*decltype(_impl_._cached_size_)*/{}
172 , decltype(_impl_.serving_region_){}
173 , decltype(_impl_.bandwidth_estimate_bytes_per_second_){0}
174 , decltype(_impl_.min_rtt_ms_){0}
175 , decltype(_impl_.previous_connection_state_){0}
176 , decltype(_impl_.max_bandwidth_estimate_bytes_per_second_){0}
177 , decltype(_impl_.max_bandwidth_timestamp_seconds_){int64_t{0}}
178 , decltype(_impl_.timestamp_){int64_t{0}}
179 };
180 _impl_.serving_region_.InitDefault();
181 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
182 _impl_.serving_region_.Set("", GetArenaForAllocation());
183 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
184 }
185
~CachedNetworkParameters()186 CachedNetworkParameters::~CachedNetworkParameters() {
187 // @@protoc_insertion_point(destructor:quic.CachedNetworkParameters)
188 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
189 (void)arena;
190 return;
191 }
192 SharedDtor();
193 }
194
SharedDtor()195 inline void CachedNetworkParameters::SharedDtor() {
196 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
197 _impl_.serving_region_.Destroy();
198 }
199
SetCachedSize(int size) const200 void CachedNetworkParameters::SetCachedSize(int size) const {
201 _impl_._cached_size_.Set(size);
202 }
203
Clear()204 void CachedNetworkParameters::Clear() {
205 // @@protoc_insertion_point(message_clear_start:quic.CachedNetworkParameters)
206 uint32_t cached_has_bits = 0;
207 // Prevent compiler warnings about cached_has_bits being unused
208 (void) cached_has_bits;
209
210 cached_has_bits = _impl_._has_bits_[0];
211 if (cached_has_bits & 0x00000001u) {
212 _impl_.serving_region_.ClearNonDefaultToEmpty();
213 }
214 if (cached_has_bits & 0x0000007eu) {
215 ::memset(&_impl_.bandwidth_estimate_bytes_per_second_, 0, static_cast<size_t>(
216 reinterpret_cast<char*>(&_impl_.timestamp_) -
217 reinterpret_cast<char*>(&_impl_.bandwidth_estimate_bytes_per_second_)) + sizeof(_impl_.timestamp_));
218 }
219 _impl_._has_bits_.Clear();
220 _internal_metadata_.Clear<std::string>();
221 }
222
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)223 const char* CachedNetworkParameters::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
224 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
225 _Internal::HasBits has_bits{};
226 while (!ctx->Done(&ptr)) {
227 uint32_t tag;
228 ptr = ::_pbi::ReadTag(ptr, &tag);
229 switch (tag >> 3) {
230 // optional string serving_region = 1;
231 case 1:
232 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
233 auto str = _internal_mutable_serving_region();
234 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
235 CHK_(ptr);
236 } else
237 goto handle_unusual;
238 continue;
239 // optional int32 bandwidth_estimate_bytes_per_second = 2;
240 case 2:
241 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
242 _Internal::set_has_bandwidth_estimate_bytes_per_second(&has_bits);
243 _impl_.bandwidth_estimate_bytes_per_second_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
244 CHK_(ptr);
245 } else
246 goto handle_unusual;
247 continue;
248 // optional int32 min_rtt_ms = 3;
249 case 3:
250 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
251 _Internal::set_has_min_rtt_ms(&has_bits);
252 _impl_.min_rtt_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
253 CHK_(ptr);
254 } else
255 goto handle_unusual;
256 continue;
257 // optional int32 previous_connection_state = 4;
258 case 4:
259 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
260 _Internal::set_has_previous_connection_state(&has_bits);
261 _impl_.previous_connection_state_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
262 CHK_(ptr);
263 } else
264 goto handle_unusual;
265 continue;
266 // optional int32 max_bandwidth_estimate_bytes_per_second = 5;
267 case 5:
268 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
269 _Internal::set_has_max_bandwidth_estimate_bytes_per_second(&has_bits);
270 _impl_.max_bandwidth_estimate_bytes_per_second_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
271 CHK_(ptr);
272 } else
273 goto handle_unusual;
274 continue;
275 // optional int64 max_bandwidth_timestamp_seconds = 6;
276 case 6:
277 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
278 _Internal::set_has_max_bandwidth_timestamp_seconds(&has_bits);
279 _impl_.max_bandwidth_timestamp_seconds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
280 CHK_(ptr);
281 } else
282 goto handle_unusual;
283 continue;
284 // optional int64 timestamp = 7;
285 case 7:
286 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
287 _Internal::set_has_timestamp(&has_bits);
288 _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
289 CHK_(ptr);
290 } else
291 goto handle_unusual;
292 continue;
293 default:
294 goto handle_unusual;
295 } // switch
296 handle_unusual:
297 if ((tag == 0) || ((tag & 7) == 4)) {
298 CHK_(ptr);
299 ctx->SetLastTag(tag);
300 goto message_done;
301 }
302 ptr = UnknownFieldParse(
303 tag,
304 _internal_metadata_.mutable_unknown_fields<std::string>(),
305 ptr, ctx);
306 CHK_(ptr != nullptr);
307 } // while
308 message_done:
309 _impl_._has_bits_.Or(has_bits);
310 return ptr;
311 failure:
312 ptr = nullptr;
313 goto message_done;
314 #undef CHK_
315 }
316
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const317 uint8_t* CachedNetworkParameters::_InternalSerialize(
318 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
319 // @@protoc_insertion_point(serialize_to_array_start:quic.CachedNetworkParameters)
320 uint32_t cached_has_bits = 0;
321 (void) cached_has_bits;
322
323 cached_has_bits = _impl_._has_bits_[0];
324 // optional string serving_region = 1;
325 if (cached_has_bits & 0x00000001u) {
326 target = stream->WriteStringMaybeAliased(
327 1, this->_internal_serving_region(), target);
328 }
329
330 // optional int32 bandwidth_estimate_bytes_per_second = 2;
331 if (cached_has_bits & 0x00000002u) {
332 target = stream->EnsureSpace(target);
333 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_bandwidth_estimate_bytes_per_second(), target);
334 }
335
336 // optional int32 min_rtt_ms = 3;
337 if (cached_has_bits & 0x00000004u) {
338 target = stream->EnsureSpace(target);
339 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_min_rtt_ms(), target);
340 }
341
342 // optional int32 previous_connection_state = 4;
343 if (cached_has_bits & 0x00000008u) {
344 target = stream->EnsureSpace(target);
345 target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_previous_connection_state(), target);
346 }
347
348 // optional int32 max_bandwidth_estimate_bytes_per_second = 5;
349 if (cached_has_bits & 0x00000010u) {
350 target = stream->EnsureSpace(target);
351 target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_max_bandwidth_estimate_bytes_per_second(), target);
352 }
353
354 // optional int64 max_bandwidth_timestamp_seconds = 6;
355 if (cached_has_bits & 0x00000020u) {
356 target = stream->EnsureSpace(target);
357 target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_max_bandwidth_timestamp_seconds(), target);
358 }
359
360 // optional int64 timestamp = 7;
361 if (cached_has_bits & 0x00000040u) {
362 target = stream->EnsureSpace(target);
363 target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_timestamp(), target);
364 }
365
366 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
367 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
368 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
369 }
370 // @@protoc_insertion_point(serialize_to_array_end:quic.CachedNetworkParameters)
371 return target;
372 }
373
ByteSizeLong() const374 size_t CachedNetworkParameters::ByteSizeLong() const {
375 // @@protoc_insertion_point(message_byte_size_start:quic.CachedNetworkParameters)
376 size_t total_size = 0;
377
378 uint32_t cached_has_bits = 0;
379 // Prevent compiler warnings about cached_has_bits being unused
380 (void) cached_has_bits;
381
382 cached_has_bits = _impl_._has_bits_[0];
383 if (cached_has_bits & 0x0000007fu) {
384 // optional string serving_region = 1;
385 if (cached_has_bits & 0x00000001u) {
386 total_size += 1 +
387 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
388 this->_internal_serving_region());
389 }
390
391 // optional int32 bandwidth_estimate_bytes_per_second = 2;
392 if (cached_has_bits & 0x00000002u) {
393 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_bandwidth_estimate_bytes_per_second());
394 }
395
396 // optional int32 min_rtt_ms = 3;
397 if (cached_has_bits & 0x00000004u) {
398 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_min_rtt_ms());
399 }
400
401 // optional int32 previous_connection_state = 4;
402 if (cached_has_bits & 0x00000008u) {
403 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_previous_connection_state());
404 }
405
406 // optional int32 max_bandwidth_estimate_bytes_per_second = 5;
407 if (cached_has_bits & 0x00000010u) {
408 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_bandwidth_estimate_bytes_per_second());
409 }
410
411 // optional int64 max_bandwidth_timestamp_seconds = 6;
412 if (cached_has_bits & 0x00000020u) {
413 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_max_bandwidth_timestamp_seconds());
414 }
415
416 // optional int64 timestamp = 7;
417 if (cached_has_bits & 0x00000040u) {
418 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp());
419 }
420
421 }
422 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
423 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
424 }
425 int cached_size = ::_pbi::ToCachedSize(total_size);
426 SetCachedSize(cached_size);
427 return total_size;
428 }
429
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)430 void CachedNetworkParameters::CheckTypeAndMergeFrom(
431 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
432 MergeFrom(*::_pbi::DownCast<const CachedNetworkParameters*>(
433 &from));
434 }
435
MergeFrom(const CachedNetworkParameters & from)436 void CachedNetworkParameters::MergeFrom(const CachedNetworkParameters& from) {
437 CachedNetworkParameters* const _this = this;
438 // @@protoc_insertion_point(class_specific_merge_from_start:quic.CachedNetworkParameters)
439 GOOGLE_DCHECK_NE(&from, _this);
440 uint32_t cached_has_bits = 0;
441 (void) cached_has_bits;
442
443 cached_has_bits = from._impl_._has_bits_[0];
444 if (cached_has_bits & 0x0000007fu) {
445 if (cached_has_bits & 0x00000001u) {
446 _this->_internal_set_serving_region(from._internal_serving_region());
447 }
448 if (cached_has_bits & 0x00000002u) {
449 _this->_impl_.bandwidth_estimate_bytes_per_second_ = from._impl_.bandwidth_estimate_bytes_per_second_;
450 }
451 if (cached_has_bits & 0x00000004u) {
452 _this->_impl_.min_rtt_ms_ = from._impl_.min_rtt_ms_;
453 }
454 if (cached_has_bits & 0x00000008u) {
455 _this->_impl_.previous_connection_state_ = from._impl_.previous_connection_state_;
456 }
457 if (cached_has_bits & 0x00000010u) {
458 _this->_impl_.max_bandwidth_estimate_bytes_per_second_ = from._impl_.max_bandwidth_estimate_bytes_per_second_;
459 }
460 if (cached_has_bits & 0x00000020u) {
461 _this->_impl_.max_bandwidth_timestamp_seconds_ = from._impl_.max_bandwidth_timestamp_seconds_;
462 }
463 if (cached_has_bits & 0x00000040u) {
464 _this->_impl_.timestamp_ = from._impl_.timestamp_;
465 }
466 _this->_impl_._has_bits_[0] |= cached_has_bits;
467 }
468 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
469 }
470
CopyFrom(const CachedNetworkParameters & from)471 void CachedNetworkParameters::CopyFrom(const CachedNetworkParameters& from) {
472 // @@protoc_insertion_point(class_specific_copy_from_start:quic.CachedNetworkParameters)
473 if (&from == this) return;
474 Clear();
475 MergeFrom(from);
476 }
477
IsInitialized() const478 bool CachedNetworkParameters::IsInitialized() const {
479 return true;
480 }
481
InternalSwap(CachedNetworkParameters * other)482 void CachedNetworkParameters::InternalSwap(CachedNetworkParameters* other) {
483 using std::swap;
484 auto* lhs_arena = GetArenaForAllocation();
485 auto* rhs_arena = other->GetArenaForAllocation();
486 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
487 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
488 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
489 &_impl_.serving_region_, lhs_arena,
490 &other->_impl_.serving_region_, rhs_arena
491 );
492 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
493 PROTOBUF_FIELD_OFFSET(CachedNetworkParameters, _impl_.timestamp_)
494 + sizeof(CachedNetworkParameters::_impl_.timestamp_)
495 - PROTOBUF_FIELD_OFFSET(CachedNetworkParameters, _impl_.bandwidth_estimate_bytes_per_second_)>(
496 reinterpret_cast<char*>(&_impl_.bandwidth_estimate_bytes_per_second_),
497 reinterpret_cast<char*>(&other->_impl_.bandwidth_estimate_bytes_per_second_));
498 }
499
GetTypeName() const500 std::string CachedNetworkParameters::GetTypeName() const {
501 return "quic.CachedNetworkParameters";
502 }
503
504
505 // @@protoc_insertion_point(namespace_scope)
506 } // namespace quic
507 PROTOBUF_NAMESPACE_OPEN
508 template<> PROTOBUF_NOINLINE ::quic::CachedNetworkParameters*
CreateMaybeMessage(Arena * arena)509 Arena::CreateMaybeMessage< ::quic::CachedNetworkParameters >(Arena* arena) {
510 return Arena::CreateMessageInternal< ::quic::CachedNetworkParameters >(arena);
511 }
512 PROTOBUF_NAMESPACE_CLOSE
513
514 // @@protoc_insertion_point(global_scope)
515 #include <google/protobuf/port_undef.inc>
516