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

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

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Update to new HEAD (b7632464b4) + restore GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER Created 4 years, 1 month 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 c49ebceb5bb7f2e5b887d3fedf5e6dbc1368e74f..5d80d297040ae0e80fc2177640dfec5a502b2471 100644
--- a/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
+++ b/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
@@ -29,6 +29,7 @@ const ::google::protobuf::internal::GeneratedMessageReflection*
} // namespace
+void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
const ::google::protobuf::FileDescriptor* file =
@@ -42,56 +43,70 @@ void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
FieldMask_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
FieldMask_descriptor_,
- FieldMask::default_instance_,
+ FieldMask::internal_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_));
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metadata_));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
-inline void protobuf_AssignDescriptorsOnce() {
+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::MessageFactory::InternalRegisterGeneratedMessage(
- FieldMask_descriptor_, &FieldMask::default_instance());
+ FieldMask_descriptor_, FieldMask::internal_default_instance());
}
} // namespace
void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto() {
- delete FieldMask::default_instance_;
+ FieldMask_default_instance_.Shutdown();
delete FieldMask_reflection_;
}
-void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
- static bool already_here = false;
- if (already_here) return;
- already_here = true;
+void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl() {
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ ::google::protobuf::internal::GetEmptyString();
+ FieldMask_default_instance_.DefaultConstruct();
+ FieldMask_default_instance_.get_mutable()->InitAsDefaultInstance();
+}
+
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_once_);
+void protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto() {
+ ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_once_,
+ &protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto_impl);
+}
+void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto_impl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
+ protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\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);
+ "N\n\023com.google.protobufB\016FieldMaskProtoP\001"
+ "\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypesb"
+ "\006proto3", 167);
::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() {
@@ -101,9 +116,9 @@ struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto {
namespace {
-static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
+static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN;
static void MergeFromFail(int line) {
- GOOGLE_CHECK(false) << __FILE__ << ":" << line;
+ ::google::protobuf::internal::MergeFromFail(__FILE__, line);
}
} // namespace
@@ -117,25 +132,23 @@ const int FieldMask::kPathsFieldNumber;
FieldMask::FieldMask()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
+ if (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) {
SharedCtor();
- MergeFrom(from);
+ UnsafeMergeFrom(from);
// @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask)
}
void FieldMask::SharedCtor() {
- _is_default_instance_ = false;
- ::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
}
@@ -145,8 +158,6 @@ FieldMask::~FieldMask() {
}
void FieldMask::SharedDtor() {
- if (this != default_instance_) {
- }
}
void FieldMask::SetCachedSize(int size) const {
@@ -160,11 +171,11 @@ const ::google::protobuf::Descriptor* FieldMask::descriptor() {
}
const FieldMask& FieldMask::default_instance() {
- if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
- return *default_instance_;
+ protobuf_InitDefaults_google_2fprotobuf_2ffield_5fmask_2eproto();
+ return *internal_default_instance();
}
-FieldMask* FieldMask::default_instance_ = NULL;
+::google::protobuf::internal::ExplicitlyConstructed<FieldMask> FieldMask_default_instance_;
FieldMask* FieldMask::New(::google::protobuf::Arena* arena) const {
FieldMask* n = new FieldMask;
@@ -245,8 +256,9 @@ void FieldMask::SerializeWithCachedSizes(
// @@protoc_insertion_point(serialize_end:google.protobuf.FieldMask)
}
-::google::protobuf::uint8* FieldMask::SerializeWithCachedSizesToArray(
- ::google::protobuf::uint8* target) const {
+::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray(
+ bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask)
// repeated string paths = 1;
for (int i = 0; i < this->paths_size(); i++) {
@@ -262,19 +274,21 @@ void FieldMask::SerializeWithCachedSizes(
return target;
}
-int FieldMask::ByteSize() const {
+size_t FieldMask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldMask)
- int total_size = 0;
+ size_t total_size = 0;
// repeated string paths = 1;
- total_size += 1 * this->paths_size();
+ total_size += 1 *
+ ::google::protobuf::internal::FromIntSize(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_ = total_size;
+ _cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
@@ -282,7 +296,7 @@ int FieldMask::ByteSize() const {
void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldMask)
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
- const FieldMask* source =
+ const FieldMask* source =
::google::protobuf::internal::DynamicCastToGenerated<const FieldMask>(
&from);
if (source == NULL) {
@@ -290,14 +304,22 @@ void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldMask)
- MergeFrom(*source);
+ UnsafeMergeFrom(*source);
}
}
void FieldMask::MergeFrom(const FieldMask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldMask)
- if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
- paths_.MergeFrom(from.paths_);
+ if (GOOGLE_PREDICT_TRUE(&from != this)) {
+ UnsafeMergeFrom(from);
+ } else {
+ MergeFromFail(__LINE__);
+ }
+}
+
+void FieldMask::UnsafeMergeFrom(const FieldMask& from) {
+ GOOGLE_DCHECK(&from != this);
+ paths_.UnsafeMergeFrom(from.paths_);
}
void FieldMask::CopyFrom(const ::google::protobuf::Message& from) {
@@ -311,7 +333,7 @@ void FieldMask::CopyFrom(const FieldMask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldMask)
if (&from == this) return;
Clear();
- MergeFrom(from);
+ UnsafeMergeFrom(from);
}
bool FieldMask::IsInitialized() const {
@@ -347,54 +369,57 @@ 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_;
}
+inline const FieldMask* FieldMask::internal_default_instance() {
+ return &FieldMask_default_instance_.get();
+}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)

Powered by Google App Engine
This is Rietveld 408576698