Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: third_party/protobuf/src/google/protobuf/field_mask.pb.cc

Issue 2590803003: Revert "third_party/protobuf: Update to HEAD (83d681ee2c)" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/field_mask.pb.cc
diff --git a/third_party/protobuf/src/google/protobuf/field_mask.pb.cc b/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
index b7925b88e3ae813b9e6de5e720955dc552ad6ac2..c49ebceb5bb7f2e5b887d3fedf5e6dbc1368e74f 100644
--- a/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
+++ b/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
@@ -19,97 +19,79 @@
namespace google {
namespace protobuf {
-class FieldMaskDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<FieldMask> {};
-FieldMaskDefaultTypeInternal _FieldMask_default_instance_;
namespace {
-::google::protobuf::Metadata file_level_metadata[1];
+const ::google::protobuf::Descriptor* FieldMask_descriptor_ = NULL;
+const ::google::protobuf::internal::GeneratedMessageReflection*
+ FieldMask_reflection_ = NULL;
} // namespace
-const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto() GOOGLE_ATTRIBUTE_COLD;
-const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto() {
- static const ::google::protobuf::uint32 offsets[] = {
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_),
- ~0u, // no _extensions_
- ~0u, // no _oneof_case_
+void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
+ protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
+ const ::google::protobuf::FileDescriptor* file =
+ ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
+ "google/protobuf/field_mask.proto");
+ GOOGLE_CHECK(file != NULL);
+ FieldMask_descriptor_ = file->message_type(0);
+ static const int FieldMask_offsets_[1] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_),
};
- return offsets;
+ FieldMask_reflection_ =
+ ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
+ FieldMask_descriptor_,
+ FieldMask::default_instance_,
+ FieldMask_offsets_,
+ -1,
+ -1,
+ -1,
+ sizeof(FieldMask),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _is_default_instance_));
}
-static const ::google::protobuf::internal::MigrationSchema schemas[] = {
- { 0, -1, sizeof(FieldMask)},
-};
-
-static const ::google::protobuf::internal::DefaultInstanceData file_default_instances[] = {
- {reinterpret_cast<const ::google::protobuf::Message*>(&_FieldMask_default_instance_), NULL},
-};
-
namespace {
-void protobuf_AssignDescriptors() {
- protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
- ::google::protobuf::MessageFactory* factory = NULL;
- AssignDescriptors(
- "google/protobuf/field_mask.proto", schemas, file_default_instances, protobuf_Offsets_google_2fprotobuf_2ffield_5fmask_2eproto(), factory,
- file_level_metadata, NULL, NULL);
-}
-
-void protobuf_AssignDescriptorsOnce() {
- static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
- ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
+inline void protobuf_AssignDescriptorsOnce() {
+ ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
+ &protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto);
}
-void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
- ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
+ ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
+ FieldMask_descriptor_, &FieldMask::default_instance());
}
} // namespace
void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto() {
- _FieldMask_default_instance_.Shutdown();
- delete file_level_metadata[0].reflection;
+ delete FieldMask::default_instance_;
+ delete FieldMask_reflection_;
}
-void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl() {
+void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
+ static bool already_here = false;
+ if (already_here) return;
+ already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
- ::google::protobuf::internal::InitProtobufDefaults();
- _FieldMask_default_instance_.DefaultConstruct();
-}
-
-void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto() {
- static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
- ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl);
-}
-void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl() {
- protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto();
- static const char descriptor[] = {
- "\n google/protobuf/field_mask.proto\022\017goog"
- "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
- "\211\001\n\023com.google.protobufB\016FieldMaskProtoP"
- "\001Z9google.golang.org/genproto/protobuf/f"
- "ield_mask;field_mask\242\002\003GPB\252\002\036Google.Prot"
- "obuf.WellKnownTypesb\006proto3"
- };
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
- descriptor, 227);
+ "\n google/protobuf/field_mask.proto\022\017goog"
+ "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
+ "Q\n\023com.google.protobufB\016FieldMaskProtoP\001"
+ "\240\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTyp"
+ "esb\006proto3", 170);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
+ FieldMask::default_instance_ = new FieldMask();
+ FieldMask::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto);
}
-GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_once_);
-void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
- ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_once_,
- &protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl);
-}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto {
StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto() {
@@ -117,6 +99,16 @@ struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto {
}
} static_descriptor_initializer_google_2fprotobuf_2ffield_5fmask_2eproto_;
+namespace {
+
+static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
+static void MergeFromFail(int line) {
+ GOOGLE_CHECK(false) << __FILE__ << ":" << line;
+}
+
+} // namespace
+
+
// ===================================================================
#if !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -125,22 +117,25 @@ const int FieldMask::kPathsFieldNumber;
FieldMask::FieldMask()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
- if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
- protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto();
- }
SharedCtor();
// @@protoc_insertion_point(constructor:google.protobuf.FieldMask)
}
+
+void FieldMask::InitAsDefaultInstance() {
+ _is_default_instance_ = true;
+}
+
FieldMask::FieldMask(const FieldMask& from)
: ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- paths_(from.paths_),
- _cached_size_(0) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
+ _internal_metadata_(NULL) {
+ SharedCtor();
+ MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask)
}
void FieldMask::SharedCtor() {
+ _is_default_instance_ = false;
+ ::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
}
@@ -150,6 +145,8 @@ FieldMask::~FieldMask() {
}
void FieldMask::SharedDtor() {
+ if (this != default_instance_) {
+ }
}
void FieldMask::SetCachedSize(int size) const {
@@ -159,14 +156,16 @@ void FieldMask::SetCachedSize(int size) const {
}
const ::google::protobuf::Descriptor* FieldMask::descriptor() {
protobuf_AssignDescriptorsOnce();
- return file_level_metadata[0].descriptor;
+ return FieldMask_descriptor_;
}
const FieldMask& FieldMask::default_instance() {
- protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto();
- return *internal_default_instance();
+ if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
+ return *default_instance_;
}
+FieldMask* FieldMask::default_instance_ = NULL;
+
FieldMask* FieldMask::New(::google::protobuf::Arena* arena) const {
FieldMask* n = new FieldMask;
if (arena != NULL) {
@@ -186,13 +185,14 @@ bool FieldMask::MergePartialFromCodedStream(
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:google.protobuf.FieldMask)
for (;;) {
- ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
+ ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated string paths = 1;
case 1: {
- if (tag == 10u) {
+ if (tag == 10) {
+ parse_paths:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->add_paths()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
@@ -203,6 +203,8 @@ bool FieldMask::MergePartialFromCodedStream(
} else {
goto handle_unusual;
}
+ if (input->ExpectTag(10)) goto parse_paths;
+ if (input->ExpectAtEnd()) goto success;
break;
}
@@ -243,9 +245,8 @@ void FieldMask::SerializeWithCachedSizes(
// @@protoc_insertion_point(serialize_end:google.protobuf.FieldMask)
}
-::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
+::google::protobuf::uint8* FieldMask::SerializeWithCachedSizesToArray(
+ ::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask)
// repeated string paths = 1;
for (int i = 0; i < this->paths_size(); i++) {
@@ -261,29 +262,27 @@ void FieldMask::SerializeWithCachedSizes(
return target;
}
-size_t FieldMask::ByteSizeLong() const {
+int FieldMask::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldMask)
- size_t total_size = 0;
+ int total_size = 0;
// repeated string paths = 1;
- total_size += 1 *
- ::google::protobuf::internal::FromIntSize(this->paths_size());
+ total_size += 1 * this->paths_size();
for (int i = 0; i < this->paths_size(); i++) {
total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
this->paths(i));
}
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _cached_size_ = cached_size;
+ _cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldMask)
- GOOGLE_DCHECK_NE(&from, this);
- const FieldMask* source =
+ if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
+ const FieldMask* source =
::google::protobuf::internal::DynamicCastToGenerated<const FieldMask>(
&from);
if (source == NULL) {
@@ -297,8 +296,7 @@ void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
void FieldMask::MergeFrom(const FieldMask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldMask)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
+ if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
paths_.MergeFrom(from.paths_);
}
@@ -317,6 +315,7 @@ void FieldMask::CopyFrom(const FieldMask& from) {
}
bool FieldMask::IsInitialized() const {
+
return true;
}
@@ -326,12 +325,16 @@ void FieldMask::Swap(FieldMask* other) {
}
void FieldMask::InternalSwap(FieldMask* other) {
paths_.UnsafeArenaSwap(&other->paths_);
+ _internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata FieldMask::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
- return file_level_metadata[0];
+ ::google::protobuf::Metadata metadata;
+ metadata.descriptor = FieldMask_descriptor_;
+ metadata.reflection = FieldMask_reflection_;
+ return metadata;
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
@@ -344,49 +347,49 @@ int FieldMask::paths_size() const {
void FieldMask::clear_paths() {
paths_.Clear();
}
-const ::std::string& FieldMask::paths(int index) const {
+ const ::std::string& FieldMask::paths(int index) const {
// @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)
return paths_.Get(index);
}
-::std::string* FieldMask::mutable_paths(int index) {
+ ::std::string* FieldMask::mutable_paths(int index) {
// @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths)
return paths_.Mutable(index);
}
-void FieldMask::set_paths(int index, const ::std::string& value) {
+ void FieldMask::set_paths(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
paths_.Mutable(index)->assign(value);
}
-void FieldMask::set_paths(int index, const char* value) {
+ void FieldMask::set_paths(int index, const char* value) {
paths_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths)
}
-void FieldMask::set_paths(int index, const char* value, size_t size) {
+ void FieldMask::set_paths(int index, const char* value, size_t size) {
paths_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths)
}
-::std::string* FieldMask::add_paths() {
+ ::std::string* FieldMask::add_paths() {
// @@protoc_insertion_point(field_add_mutable:google.protobuf.FieldMask.paths)
return paths_.Add();
}
-void FieldMask::add_paths(const ::std::string& value) {
+ void FieldMask::add_paths(const ::std::string& value) {
paths_.Add()->assign(value);
// @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)
}
-void FieldMask::add_paths(const char* value) {
+ void FieldMask::add_paths(const char* value) {
paths_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths)
}
-void FieldMask::add_paths(const char* value, size_t size) {
+ void FieldMask::add_paths(const char* value, size_t size) {
paths_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths)
}
-const ::google::protobuf::RepeatedPtrField< ::std::string>&
+ const ::google::protobuf::RepeatedPtrField< ::std::string>&
FieldMask::paths() const {
// @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths)
return paths_;
}
-::google::protobuf::RepeatedPtrField< ::std::string>*
+ ::google::protobuf::RepeatedPtrField< ::std::string>*
FieldMask::mutable_paths() {
// @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths)
return &paths_;

Powered by Google App Engine
This is Rietveld 408576698