Index: third_party/protobuf/src/google/protobuf/unknown_field_set.h |
diff --git a/third_party/protobuf/src/google/protobuf/unknown_field_set.h b/third_party/protobuf/src/google/protobuf/unknown_field_set.h |
index 612a942a771d84da2392bc5c8d47877b7447a2d2..c2ad89182dcdb8934cc1a93e7e2d5fb508d94028 100644 |
--- a/third_party/protobuf/src/google/protobuf/unknown_field_set.h |
+++ b/third_party/protobuf/src/google/protobuf/unknown_field_set.h |
@@ -52,6 +52,7 @@ namespace protobuf { |
class ZeroCopyInputStream; // zero_copy_stream.h |
} |
namespace internal { |
+ class InternalMetadataWithArena; // metadata.h |
class WireFormat; // wire_format.h |
class MessageSetFieldSkipperUsingCord; |
// extension_set_heavy.cc |
@@ -92,6 +93,13 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet { |
// Similar to above, but this function will destroy the contents of other. |
void MergeFromAndDestroy(UnknownFieldSet* other); |
+ // Merge the contents an UnknownFieldSet with the UnknownFieldSet in |
+ // *metadata, if there is one. If *metadata doesn't have an UnknownFieldSet |
+ // then add one to it and make it be a copy of the first arg. |
+ static void MergeToInternalMetdata( |
+ const UnknownFieldSet& other, |
+ internal::InternalMetadataWithArena* metadata); |
+ |
// Swaps the contents of some other UnknownFieldSet with this one. |
inline void Swap(UnknownFieldSet* x); |
@@ -175,7 +183,7 @@ class LIBPROTOBUF_EXPORT UnknownField { |
TYPE_GROUP |
}; |
- // The field's tag number, as seen on the wire. |
+ // The field's field number, as seen on the wire. |
inline int number() const; |
// The field type. |
@@ -204,7 +212,7 @@ class LIBPROTOBUF_EXPORT UnknownField { |
void SerializeLengthDelimitedNoTag(io::CodedOutputStream* output) const; |
uint8* SerializeLengthDelimitedNoTagToArray(uint8* target) const; |
- inline int GetLengthDelimitedSize() const; |
+ inline size_t GetLengthDelimitedSize() const; |
private: |
friend class UnknownFieldSet; |
@@ -241,8 +249,14 @@ class LIBPROTOBUF_EXPORT UnknownField { |
// =================================================================== |
// inline implementations |
+inline UnknownFieldSet::UnknownFieldSet() : fields_(NULL) {} |
+ |
+inline UnknownFieldSet::~UnknownFieldSet() { Clear(); } |
+ |
+inline void UnknownFieldSet::ClearAndFreeMemory() { Clear(); } |
+ |
inline void UnknownFieldSet::Clear() { |
- if (fields_) { |
+ if (fields_ != NULL) { |
ClearFallback(); |
} |
} |
@@ -324,9 +338,9 @@ inline UnknownFieldSet* UnknownField::mutable_group() { |
return group_; |
} |
-inline int UnknownField::GetLengthDelimitedSize() const { |
+inline size_t UnknownField::GetLengthDelimitedSize() const { |
GOOGLE_DCHECK_EQ(TYPE_LENGTH_DELIMITED, type()); |
- return static_cast<int>(length_delimited_.string_value_->size()); |
+ return length_delimited_.string_value_->size(); |
} |
inline void UnknownField::SetType(Type type) { |