Source code
Revision control
Copy as Markdown
Other Tools
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: fetch_msg_types.proto
#include "fetch_msg_types.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace mozilla {
namespace appservices {
namespace httpconfig {
namespace protobuf {
PROTOBUF_CONSTEXPR Request_HeadersEntry_DoNotUse::Request_HeadersEntry_DoNotUse(
::_pbi::ConstantInitialized) {}
struct Request_HeadersEntry_DoNotUseDefaultTypeInternal {
PROTOBUF_CONSTEXPR Request_HeadersEntry_DoNotUseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~Request_HeadersEntry_DoNotUseDefaultTypeInternal() {}
union {
Request_HeadersEntry_DoNotUse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Request_HeadersEntry_DoNotUseDefaultTypeInternal _Request_HeadersEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR Request::Request(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{}
, /*decltype(_impl_.url_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.body_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.method_)*/0
, /*decltype(_impl_.follow_redirects_)*/false
, /*decltype(_impl_.use_caches_)*/false
, /*decltype(_impl_.connect_timeout_secs_)*/0
, /*decltype(_impl_.read_timeout_secs_)*/0} {}
struct RequestDefaultTypeInternal {
PROTOBUF_CONSTEXPR RequestDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~RequestDefaultTypeInternal() {}
union {
Request _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestDefaultTypeInternal _Request_default_instance_;
PROTOBUF_CONSTEXPR Response_HeadersEntry_DoNotUse::Response_HeadersEntry_DoNotUse(
::_pbi::ConstantInitialized) {}
struct Response_HeadersEntry_DoNotUseDefaultTypeInternal {
PROTOBUF_CONSTEXPR Response_HeadersEntry_DoNotUseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~Response_HeadersEntry_DoNotUseDefaultTypeInternal() {}
union {
Response_HeadersEntry_DoNotUse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Response_HeadersEntry_DoNotUseDefaultTypeInternal _Response_HeadersEntry_DoNotUse_default_instance_;
PROTOBUF_CONSTEXPR Response::Response(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{}
, /*decltype(_impl_.exception_message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.url_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.body_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.status_)*/0} {}
struct ResponseDefaultTypeInternal {
PROTOBUF_CONSTEXPR ResponseDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~ResponseDefaultTypeInternal() {}
union {
Response _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseDefaultTypeInternal _Response_default_instance_;
} // namespace protobuf
} // namespace httpconfig
} // namespace appservices
} // namespace mozilla
namespace mozilla {
namespace appservices {
namespace httpconfig {
namespace protobuf {
bool Request_Method_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
return true;
default:
return false;
}
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> Request_Method_strings[9] = {};
static const char Request_Method_names[] =
"CONNECT"
"DELETE"
"GET"
"HEAD"
"OPTIONS"
"PATCH"
"POST"
"PUT"
"TRACE";
static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Request_Method_entries[] = {
{ {Request_Method_names + 0, 7}, 5 },
{ {Request_Method_names + 7, 6}, 4 },
{ {Request_Method_names + 13, 3}, 0 },
{ {Request_Method_names + 16, 4}, 1 },
{ {Request_Method_names + 20, 7}, 6 },
{ {Request_Method_names + 27, 5}, 8 },
{ {Request_Method_names + 32, 4}, 2 },
{ {Request_Method_names + 36, 3}, 3 },
{ {Request_Method_names + 39, 5}, 7 },
};
static const int Request_Method_entries_by_number[] = {
2, // 0 -> GET
3, // 1 -> HEAD
6, // 2 -> POST
7, // 3 -> PUT
1, // 4 -> DELETE
0, // 5 -> CONNECT
4, // 6 -> OPTIONS
8, // 7 -> TRACE
5, // 8 -> PATCH
};
const std::string& Request_Method_Name(
Request_Method value) {
static const bool dummy =
::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
Request_Method_entries,
Request_Method_entries_by_number,
9, Request_Method_strings);
(void) dummy;
int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
Request_Method_entries,
Request_Method_entries_by_number,
9, value);
return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
Request_Method_strings[idx].get();
}
bool Request_Method_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Request_Method* value) {
int int_value;
bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
Request_Method_entries, 9, name, &int_value);
if (success) {
*value = static_cast<Request_Method>(int_value);
}
return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr Request_Method Request::GET;
constexpr Request_Method Request::HEAD;
constexpr Request_Method Request::POST;
constexpr Request_Method Request::PUT;
constexpr Request_Method Request::DELETE;
constexpr Request_Method Request::CONNECT;
constexpr Request_Method Request::OPTIONS;
constexpr Request_Method Request::TRACE;
constexpr Request_Method Request::PATCH;
constexpr Request_Method Request::Method_MIN;
constexpr Request_Method Request::Method_MAX;
constexpr int Request::Method_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================
Request_HeadersEntry_DoNotUse::Request_HeadersEntry_DoNotUse() {}
Request_HeadersEntry_DoNotUse::Request_HeadersEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: SuperType(arena) {}
void Request_HeadersEntry_DoNotUse::MergeFrom(const Request_HeadersEntry_DoNotUse& other) {
MergeFromInternal(other);
}
// ===================================================================
class Request::_Internal {
public:
using HasBits = decltype(std::declval<Request>()._impl_._has_bits_);
static void set_has_method(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_url(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_body(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_follow_redirects(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_use_caches(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_connect_timeout_secs(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_read_timeout_secs(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
static bool MissingRequiredFields(const HasBits& has_bits) {
return ((has_bits[0] & 0x0000007d) ^ 0x0000007d) != 0;
}
};
Request::Request(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:mozilla.appservices.httpconfig.protobuf.Request)
}
Request::Request(const Request& from)
: ::PROTOBUF_NAMESPACE_ID::MessageLite() {
Request* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{}
, decltype(_impl_.url_){}
, decltype(_impl_.body_){}
, decltype(_impl_.method_){}
, decltype(_impl_.follow_redirects_){}
, decltype(_impl_.use_caches_){}
, decltype(_impl_.connect_timeout_secs_){}
, decltype(_impl_.read_timeout_secs_){}};
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
_this->_impl_.headers_.MergeFrom(from._impl_.headers_);
_impl_.url_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.url_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_url()) {
_this->_impl_.url_.Set(from._internal_url(),
_this->GetArenaForAllocation());
}
_impl_.body_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_body()) {
_this->_impl_.body_.Set(from._internal_body(),
_this->GetArenaForAllocation());
}
::memcpy(&_impl_.method_, &from._impl_.method_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.read_timeout_secs_) -
reinterpret_cast<char*>(&_impl_.method_)) + sizeof(_impl_.read_timeout_secs_));
// @@protoc_insertion_point(copy_constructor:mozilla.appservices.httpconfig.protobuf.Request)
}
inline void Request::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{::_pbi::ArenaInitialized(), arena}
, decltype(_impl_.url_){}
, decltype(_impl_.body_){}
, decltype(_impl_.method_){0}
, decltype(_impl_.follow_redirects_){false}
, decltype(_impl_.use_caches_){false}
, decltype(_impl_.connect_timeout_secs_){0}
, decltype(_impl_.read_timeout_secs_){0}
};
_impl_.url_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.url_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
Request::~Request() {
// @@protoc_insertion_point(destructor:mozilla.appservices.httpconfig.protobuf.Request)
if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void Request::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.headers_.Destruct();
_impl_.headers_.~MapFieldLite();
_impl_.url_.Destroy();
_impl_.body_.Destroy();
}
void Request::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void Request::Clear() {
// @@protoc_insertion_point(message_clear_start:mozilla.appservices.httpconfig.protobuf.Request)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.headers_.Clear();
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
_impl_.url_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
_impl_.body_.ClearNonDefaultToEmpty();
}
}
if (cached_has_bits & 0x0000007cu) {
::memset(&_impl_.method_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.read_timeout_secs_) -
reinterpret_cast<char*>(&_impl_.method_)) + sizeof(_impl_.read_timeout_secs_));
}
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
const char* Request::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// required .mozilla.appservices.httpconfig.protobuf.Request.Method method = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::mozilla::appservices::httpconfig::protobuf::Request_Method_IsValid(val))) {
_internal_set_method(static_cast<::mozilla::appservices::httpconfig::protobuf::Request_Method>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
// required string url = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_url();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional bytes body = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
auto str = _internal_mutable_body();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// map<string, string> headers = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(&_impl_.headers_, ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
} else
goto handle_unusual;
continue;
// required bool follow_redirects = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_Internal::set_has_follow_redirects(&has_bits);
_impl_.follow_redirects_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// required bool use_caches = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
_Internal::set_has_use_caches(&has_bits);
_impl_.use_caches_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// required int32 connect_timeout_secs = 7;
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
_Internal::set_has_connect_timeout_secs(&has_bits);
_impl_.connect_timeout_secs_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// required int32 read_timeout_secs = 8;
case 8:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
_Internal::set_has_read_timeout_secs(&has_bits);
_impl_.read_timeout_secs_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<std::string>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Request::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:mozilla.appservices.httpconfig.protobuf.Request)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
// required .mozilla.appservices.httpconfig.protobuf.Request.Method method = 1;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
1, this->_internal_method(), target);
}
// required string url = 2;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
2, this->_internal_url(), target);
}
// optional bytes body = 3;
if (cached_has_bits & 0x00000002u) {
target = stream->WriteBytesMaybeAliased(
3, this->_internal_body(), target);
}
// map<string, string> headers = 4;
if (!this->_internal_headers().empty()) {
using MapType = ::_pb::Map<std::string, std::string>;
using WireHelper = Request_HeadersEntry_DoNotUse::Funcs;
const auto& map_field = this->_internal_headers();
auto check_utf8 = [](const MapType::value_type& entry) {
(void)entry;
};
if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
target = WireHelper::InternalSerialize(4, entry.first, entry.second, target, stream);
check_utf8(entry);
}
} else {
for (const auto& entry : map_field) {
target = WireHelper::InternalSerialize(4, entry.first, entry.second, target, stream);
check_utf8(entry);
}
}
}
// required bool follow_redirects = 5;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_follow_redirects(), target);
}
// required bool use_caches = 6;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_use_caches(), target);
}
// required int32 connect_timeout_secs = 7;
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_connect_timeout_secs(), target);
}
// required int32 read_timeout_secs = 8;
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(8, this->_internal_read_timeout_secs(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:mozilla.appservices.httpconfig.protobuf.Request)
return target;
}
size_t Request::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:mozilla.appservices.httpconfig.protobuf.Request)
size_t total_size = 0;
if (_internal_has_url()) {
// required string url = 2;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_url());
}
if (_internal_has_method()) {
// required .mozilla.appservices.httpconfig.protobuf.Request.Method method = 1;
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_method());
}
if (_internal_has_follow_redirects()) {
// required bool follow_redirects = 5;
total_size += 1 + 1;
}
if (_internal_has_use_caches()) {
// required bool use_caches = 6;
total_size += 1 + 1;
}
if (_internal_has_connect_timeout_secs()) {
// required int32 connect_timeout_secs = 7;
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_connect_timeout_secs());
}
if (_internal_has_read_timeout_secs()) {
// required int32 read_timeout_secs = 8;
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_read_timeout_secs());
}
return total_size;
}
size_t Request::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mozilla.appservices.httpconfig.protobuf.Request)
size_t total_size = 0;
if (((_impl_._has_bits_[0] & 0x0000007d) ^ 0x0000007d) == 0) { // All required fields are present.
// required string url = 2;
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_url());
// required .mozilla.appservices.httpconfig.protobuf.Request.Method method = 1;
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_method());
// required bool follow_redirects = 5;
total_size += 1 + 1;
// required bool use_caches = 6;
total_size += 1 + 1;
// required int32 connect_timeout_secs = 7;
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_connect_timeout_secs());
// required int32 read_timeout_secs = 8;
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_read_timeout_secs());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// map<string, string> headers = 4;
total_size += 1 *
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_headers_size());
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
it = this->_internal_headers().begin();
it != this->_internal_headers().end(); ++it) {
total_size += Request_HeadersEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
}
// optional bytes body = 3;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_body());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
}
int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Request::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
MergeFrom(*::_pbi::DownCast<const Request*>(
&from));
}
void Request::MergeFrom(const Request& from) {
Request* const _this = this;
// @@protoc_insertion_point(class_specific_merge_from_start:mozilla.appservices.httpconfig.protobuf.Request)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
_this->_impl_.headers_.MergeFrom(from._impl_.headers_);
cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
if (cached_has_bits & 0x00000001u) {
_this->_internal_set_url(from._internal_url());
}
if (cached_has_bits & 0x00000002u) {
_this->_internal_set_body(from._internal_body());
}
if (cached_has_bits & 0x00000004u) {
_this->_impl_.method_ = from._impl_.method_;
}
if (cached_has_bits & 0x00000008u) {
_this->_impl_.follow_redirects_ = from._impl_.follow_redirects_;
}
if (cached_has_bits & 0x00000010u) {
_this->_impl_.use_caches_ = from._impl_.use_caches_;
}
if (cached_has_bits & 0x00000020u) {
_this->_impl_.connect_timeout_secs_ = from._impl_.connect_timeout_secs_;
}
if (cached_has_bits & 0x00000040u) {
_this->_impl_.read_timeout_secs_ = from._impl_.read_timeout_secs_;
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
}
_this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void Request::CopyFrom(const Request& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:mozilla.appservices.httpconfig.protobuf.Request)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Request::IsInitialized() const {
if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
return true;
}
void Request::InternalSwap(Request* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_impl_.headers_.InternalSwap(&other->_impl_.headers_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.url_, lhs_arena,
&other->_impl_.url_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.body_, lhs_arena,
&other->_impl_.body_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(Request, _impl_.read_timeout_secs_)
+ sizeof(Request::_impl_.read_timeout_secs_)
- PROTOBUF_FIELD_OFFSET(Request, _impl_.method_)>(
reinterpret_cast<char*>(&_impl_.method_),
reinterpret_cast<char*>(&other->_impl_.method_));
}
std::string Request::GetTypeName() const {
return "mozilla.appservices.httpconfig.protobuf.Request";
}
// ===================================================================
Response_HeadersEntry_DoNotUse::Response_HeadersEntry_DoNotUse() {}
Response_HeadersEntry_DoNotUse::Response_HeadersEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: SuperType(arena) {}
void Response_HeadersEntry_DoNotUse::MergeFrom(const Response_HeadersEntry_DoNotUse& other) {
MergeFromInternal(other);
}
// ===================================================================
class Response::_Internal {
public:
using HasBits = decltype(std::declval<Response>()._impl_._has_bits_);
static void set_has_exception_message(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_url(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_status(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_body(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
};
Response::Response(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:mozilla.appservices.httpconfig.protobuf.Response)
}
Response::Response(const Response& from)
: ::PROTOBUF_NAMESPACE_ID::MessageLite() {
Response* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{}
, decltype(_impl_.exception_message_){}
, decltype(_impl_.url_){}
, decltype(_impl_.body_){}
, decltype(_impl_.status_){}};
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
_this->_impl_.headers_.MergeFrom(from._impl_.headers_);
_impl_.exception_message_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.exception_message_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_exception_message()) {
_this->_impl_.exception_message_.Set(from._internal_exception_message(),
_this->GetArenaForAllocation());
}
_impl_.url_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.url_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_url()) {
_this->_impl_.url_.Set(from._internal_url(),
_this->GetArenaForAllocation());
}
_impl_.body_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (from._internal_has_body()) {
_this->_impl_.body_.Set(from._internal_body(),
_this->GetArenaForAllocation());
}
_this->_impl_.status_ = from._impl_.status_;
// @@protoc_insertion_point(copy_constructor:mozilla.appservices.httpconfig.protobuf.Response)
}
inline void Response::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.headers_)*/{::_pbi::ArenaInitialized(), arena}
, decltype(_impl_.exception_message_){}
, decltype(_impl_.url_){}
, decltype(_impl_.body_){}
, decltype(_impl_.status_){0}
};
_impl_.exception_message_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.exception_message_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.url_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.url_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.body_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
Response::~Response() {
// @@protoc_insertion_point(destructor:mozilla.appservices.httpconfig.protobuf.Response)
if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void Response::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.headers_.Destruct();
_impl_.headers_.~MapFieldLite();
_impl_.exception_message_.Destroy();
_impl_.url_.Destroy();
_impl_.body_.Destroy();
}
void Response::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void Response::Clear() {
// @@protoc_insertion_point(message_clear_start:mozilla.appservices.httpconfig.protobuf.Response)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.headers_.Clear();
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000007u) {
if (cached_has_bits & 0x00000001u) {
_impl_.exception_message_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
_impl_.url_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000004u) {
_impl_.body_.ClearNonDefaultToEmpty();
}
}
_impl_.status_ = 0;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
const char* Response::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string exception_message = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_exception_message();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional string url = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_url();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional int32 status = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
_Internal::set_has_status(&has_bits);
_impl_.status_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional bytes body = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
auto str = _internal_mutable_body();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// map<string, string> headers = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
ptr -= 1;
do {
ptr += 1;
ptr = ctx->ParseMessage(&_impl_.headers_, ptr);
CHK_(ptr);
if (!ctx->DataAvailable(ptr)) break;
} while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<std::string>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Response::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:mozilla.appservices.httpconfig.protobuf.Response)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
// optional string exception_message = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
1, this->_internal_exception_message(), target);
}
// optional string url = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->WriteStringMaybeAliased(
2, this->_internal_url(), target);
}
// optional int32 status = 3;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_status(), target);
}
// optional bytes body = 4;
if (cached_has_bits & 0x00000004u) {
target = stream->WriteBytesMaybeAliased(
4, this->_internal_body(), target);
}
// map<string, string> headers = 5;
if (!this->_internal_headers().empty()) {
using MapType = ::_pb::Map<std::string, std::string>;
using WireHelper = Response_HeadersEntry_DoNotUse::Funcs;
const auto& map_field = this->_internal_headers();
auto check_utf8 = [](const MapType::value_type& entry) {
(void)entry;
};
if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream);
check_utf8(entry);
}
} else {
for (const auto& entry : map_field) {
target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream);
check_utf8(entry);
}
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:mozilla.appservices.httpconfig.protobuf.Response)
return target;
}
size_t Response::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mozilla.appservices.httpconfig.protobuf.Response)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// map<string, string> headers = 5;
total_size += 1 *
::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_headers_size());
for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
it = this->_internal_headers().begin();
it != this->_internal_headers().end(); ++it) {
total_size += Response_HeadersEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
}
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
// optional string exception_message = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_exception_message());
}
// optional string url = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_url());
}
// optional bytes body = 4;
if (cached_has_bits & 0x00000004u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_body());
}
// optional int32 status = 3;
if (cached_has_bits & 0x00000008u) {
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_status());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
}
int cached_size = ::_pbi::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Response::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
MergeFrom(*::_pbi::DownCast<const Response*>(
&from));
}
void Response::MergeFrom(const Response& from) {
Response* const _this = this;
// @@protoc_insertion_point(class_specific_merge_from_start:mozilla.appservices.httpconfig.protobuf.Response)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
_this->_impl_.headers_.MergeFrom(from._impl_.headers_);
cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
_this->_internal_set_exception_message(from._internal_exception_message());
}
if (cached_has_bits & 0x00000002u) {
_this->_internal_set_url(from._internal_url());
}
if (cached_has_bits & 0x00000004u) {
_this->_internal_set_body(from._internal_body());
}
if (cached_has_bits & 0x00000008u) {
_this->_impl_.status_ = from._impl_.status_;
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
}
_this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void Response::CopyFrom(const Response& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:mozilla.appservices.httpconfig.protobuf.Response)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Response::IsInitialized() const {
return true;
}
void Response::InternalSwap(Response* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_impl_.headers_.InternalSwap(&other->_impl_.headers_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.exception_message_, lhs_arena,
&other->_impl_.exception_message_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.url_, lhs_arena,
&other->_impl_.url_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.body_, lhs_arena,
&other->_impl_.body_, rhs_arena
);
swap(_impl_.status_, other->_impl_.status_);
}
std::string Response::GetTypeName() const {
return "mozilla.appservices.httpconfig.protobuf.Response";
}
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
} // namespace httpconfig
} // namespace appservices
} // namespace mozilla
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::mozilla::appservices::httpconfig::protobuf::Request_HeadersEntry_DoNotUse*
Arena::CreateMaybeMessage< ::mozilla::appservices::httpconfig::protobuf::Request_HeadersEntry_DoNotUse >(Arena* arena) {
return Arena::CreateMessageInternal< ::mozilla::appservices::httpconfig::protobuf::Request_HeadersEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::mozilla::appservices::httpconfig::protobuf::Request*
Arena::CreateMaybeMessage< ::mozilla::appservices::httpconfig::protobuf::Request >(Arena* arena) {
return Arena::CreateMessageInternal< ::mozilla::appservices::httpconfig::protobuf::Request >(arena);
}
template<> PROTOBUF_NOINLINE ::mozilla::appservices::httpconfig::protobuf::Response_HeadersEntry_DoNotUse*
Arena::CreateMaybeMessage< ::mozilla::appservices::httpconfig::protobuf::Response_HeadersEntry_DoNotUse >(Arena* arena) {
return Arena::CreateMessageInternal< ::mozilla::appservices::httpconfig::protobuf::Response_HeadersEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::mozilla::appservices::httpconfig::protobuf::Response*
Arena::CreateMaybeMessage< ::mozilla::appservices::httpconfig::protobuf::Response >(Arena* arena) {
return Arena::CreateMessageInternal< ::mozilla::appservices::httpconfig::protobuf::Response >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>