Index: third_party/protobuf/src/google/protobuf/message.cc |
diff --git a/third_party/protobuf/src/google/protobuf/message.cc b/third_party/protobuf/src/google/protobuf/message.cc |
index d62ca79c80cb7d49cdf4a2dc814db293560f5f81..a5a7feb62bfdec1f9c8e9fb2b14405671bd4d20a 100644 |
--- a/third_party/protobuf/src/google/protobuf/message.cc |
+++ b/third_party/protobuf/src/google/protobuf/message.cc |
@@ -46,9 +46,9 @@ |
#include <google/protobuf/io/coded_stream.h> |
#include <google/protobuf/io/zero_copy_stream_impl.h> |
#include <google/protobuf/descriptor.pb.h> |
-#include <google/protobuf/map_field.h> |
#include <google/protobuf/descriptor.h> |
#include <google/protobuf/generated_message_util.h> |
+#include <google/protobuf/map_field.h> |
#include <google/protobuf/reflection_ops.h> |
#include <google/protobuf/wire_format.h> |
#include <google/protobuf/stubs/strutil.h> |
@@ -62,8 +62,6 @@ namespace protobuf { |
using internal::WireFormat; |
using internal::ReflectionOps; |
-Message::~Message() {} |
- |
void Message::MergeFrom(const Message& from) { |
const Descriptor* descriptor = GetDescriptor(); |
GOOGLE_CHECK_EQ(from.GetDescriptor(), descriptor) |
@@ -98,12 +96,12 @@ bool Message::IsInitialized() const { |
return ReflectionOps::IsInitialized(*this); |
} |
-void Message::FindInitializationErrors(vector<string>* errors) const { |
+void Message::FindInitializationErrors(std::vector<string>* errors) const { |
return ReflectionOps::FindInitializationErrors(*this, "", errors); |
} |
string Message::InitializationErrorString() const { |
- vector<string> errors; |
+ std::vector<string> errors; |
FindInitializationErrors(&errors); |
return Join(errors, ", "); |
} |
@@ -148,9 +146,9 @@ void Message::SerializeWithCachedSizes( |
WireFormat::SerializeWithCachedSizes(*this, GetCachedSize(), output); |
} |
-int Message::ByteSize() const { |
- int size = WireFormat::ByteSize(*this); |
- SetCachedSize(size); |
+size_t Message::ByteSizeLong() const { |
+ size_t size = WireFormat::ByteSize(*this); |
+ SetCachedSize(internal::ToCachedSize(size)); |
return size; |
} |
@@ -227,38 +225,6 @@ void* Reflection::MutableRawRepeatedString( |
} |
-// Default EnumValue API implementations. Real reflection implementations should |
-// override these. However, there are several legacy implementations that do |
-// not, and cannot easily be changed at the same time as the Reflection API, so |
-// we provide these for now. |
-// TODO: Remove these once all Reflection implementations are updated. |
-int Reflection::GetEnumValue(const Message& message, |
- const FieldDescriptor* field) const { |
- GOOGLE_LOG(FATAL) << "Unimplemented EnumValue API."; |
- return 0; |
-} |
-void Reflection::SetEnumValue(Message* message, |
- const FieldDescriptor* field, |
- int value) const { |
- GOOGLE_LOG(FATAL) << "Unimplemented EnumValue API."; |
-} |
-int Reflection::GetRepeatedEnumValue( |
- const Message& message, |
- const FieldDescriptor* field, int index) const { |
- GOOGLE_LOG(FATAL) << "Unimplemented EnumValue API."; |
- return 0; |
-} |
-void Reflection::SetRepeatedEnumValue(Message* message, |
- const FieldDescriptor* field, int index, |
- int value) const { |
- GOOGLE_LOG(FATAL) << "Unimplemented EnumValue API."; |
-} |
-void Reflection::AddEnumValue(Message* message, |
- const FieldDescriptor* field, |
- int value) const { |
- GOOGLE_LOG(FATAL) << "Unimplemented EnumValue API."; |
-} |
- |
MapIterator Reflection::MapBegin( |
Message* message, |
const FieldDescriptor* field) const { |
@@ -301,8 +267,8 @@ class GeneratedMessageFactory : public MessageFactory { |
hash_map<const char*, RegistrationFunc*, |
hash<const char*>, streq> file_map_; |
- // Initialized lazily, so requires locking. |
Mutex mutex_; |
+ // Initialized lazily, so requires locking. |
hash_map<const Descriptor*, const Message*> type_map_; |
}; |