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

Unified Diff: third_party/protobuf/src/google/protobuf/extension_set.h

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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/extension_set.h
diff --git a/third_party/protobuf/src/google/protobuf/extension_set.h b/third_party/protobuf/src/google/protobuf/extension_set.h
index 25acee7f718a1cfc2023ee4fd875d1e459f86ee1..3ea11bf41caebee61ee029526852c690a232b17f 100644
--- a/third_party/protobuf/src/google/protobuf/extension_set.h
+++ b/third_party/protobuf/src/google/protobuf/extension_set.h
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -46,12 +46,9 @@
#include <google/protobuf/stubs/common.h>
-#include <google/protobuf/repeated_field.h>
-
namespace google {
namespace protobuf {
- class Arena;
class Descriptor; // descriptor.h
class FieldDescriptor; // descriptor.h
class DescriptorPool; // descriptor.h
@@ -65,7 +62,10 @@ namespace protobuf {
}
namespace internal {
class FieldSkipper; // wire_format_lite.h
+ class RepeatedPtrFieldBase; // repeated_field.h
}
+ template <typename Element> class RepeatedField; // repeated_field.h
+ template <typename Element> class RepeatedPtrField; // repeated_field.h
}
namespace protobuf {
@@ -155,7 +155,6 @@ class LIBPROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder {
class LIBPROTOBUF_EXPORT ExtensionSet {
public:
ExtensionSet();
- explicit ExtensionSet(::google::protobuf::Arena* arena);
~ExtensionSet();
// These are called at startup by protocol-compiler-generated code to
@@ -191,7 +190,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
// directly, unless you are doing low-level memory management.
//
// When calling any of these accessors, the extension number requested
- // MUST exist in the DescriptorPool provided to the constructor. Otherwise,
+ // MUST exist in the DescriptorPool provided to the constructor. Otheriwse,
// the method will fail an assert. Normally, though, you would not call
// these directly; you would either call the generated accessors of your
// message class (e.g. GetExtension()) or you would call the accessors
@@ -259,34 +258,13 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
void SetAllocatedMessage(int number, FieldType type,
const FieldDescriptor* descriptor,
MessageLite* message);
- void UnsafeArenaSetAllocatedMessage(int number, FieldType type,
- const FieldDescriptor* descriptor,
- MessageLite* message);
MessageLite* ReleaseMessage(int number, const MessageLite& prototype);
- MessageLite* UnsafeArenaReleaseMessage(
- int number, const MessageLite& prototype);
-
MessageLite* ReleaseMessage(const FieldDescriptor* descriptor,
MessageFactory* factory);
#undef desc
- ::google::protobuf::Arena* GetArenaNoVirtual() const { return arena_; }
// repeated fields -------------------------------------------------
- // Fetches a RepeatedField extension by number; returns |default_value|
- // if no such extension exists. User should not touch this directly; it is
- // used by the GetRepeatedExtension() method.
- const void* GetRawRepeatedField(int number, const void* default_value) const;
- // Fetches a mutable version of a RepeatedField extension by number,
- // instantiating one if none exists. Similar to above, user should not use
- // this directly; it underlies MutableRepeatedExtension().
- void* MutableRawRepeatedField(int number, FieldType field_type,
- bool packed, const FieldDescriptor* desc);
-
- // This is an overload of MutableRawRepeatedField to maintain compatibility
- // with old code using a previous API. This version of
- // MutableRawRepeatedField() will GOOGLE_CHECK-fail on a missing extension.
- // (E.g.: borg/clients/internal/proto1/proto2_reflection.cc.)
void* MutableRawRepeatedField(int number);
int32 GetRepeatedInt32 (int number, int index) const;
@@ -345,7 +323,6 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
void Clear();
void MergeFrom(const ExtensionSet& other);
void Swap(ExtensionSet* other);
- void SwapExtension(ExtensionSet* other, int number);
bool IsInitialized() const;
// Parses a single extension from the input. The input should start out
@@ -361,13 +338,8 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
// methods of ExtensionSet, this only works for generated message types --
// it looks up extensions registered using RegisterExtension().
bool ParseField(uint32 tag, io::CodedInputStream* input,
- const MessageLite* containing_type);
- bool ParseField(uint32 tag, io::CodedInputStream* input,
const MessageLite* containing_type,
UnknownFieldSet* unknown_fields);
- bool ParseField(uint32 tag, io::CodedInputStream* input,
- const MessageLite* containing_type,
- io::CodedOutputStream* unknown_fields);
bool ParseFieldHeavy(uint32 tag, io::CodedInputStream* input,
const Message* containing_type,
UnknownFieldSet* unknown_fields);
@@ -381,8 +353,6 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
// Specific versions for lite or full messages (constructs the appropriate
// FieldSkipper automatically).
bool ParseMessageSet(io::CodedInputStream* input,
- const MessageLite* containing_type);
- bool ParseMessageSet(io::CodedInputStream* input,
const MessageLite* containing_type,
UnknownFieldSet* unknown_fields);
bool ParseMessageSetHeavy(io::CodedInputStream* input,
@@ -433,15 +403,12 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
LazyMessageExtension() {}
virtual ~LazyMessageExtension() {}
- virtual LazyMessageExtension* New(::google::protobuf::Arena* arena) const = 0;
+ virtual LazyMessageExtension* New() const = 0;
virtual const MessageLite& GetMessage(
const MessageLite& prototype) const = 0;
virtual MessageLite* MutableMessage(const MessageLite& prototype) = 0;
virtual void SetAllocatedMessage(MessageLite *message) = 0;
- virtual void UnsafeArenaSetAllocatedMessage(MessageLite *message) = 0;
virtual MessageLite* ReleaseMessage(const MessageLite& prototype) = 0;
- virtual MessageLite* UnsafeArenaReleaseMessage(
- const MessageLite& prototype) = 0;
virtual bool IsInitialized() const = 0;
virtual int ByteSize() const = 0;
@@ -539,40 +506,22 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
};
- // Merges existing Extension from other_extension
- void InternalExtensionMergeFrom(int number, const Extension& other_extension);
-
// Returns true and fills field_number and extension if extension is found.
- // Note to support packed repeated field compatibility, it also fills whether
- // the tag on wire is packed, which can be different from
- // extension->is_packed (whether packed=true is specified).
bool FindExtensionInfoFromTag(uint32 tag, ExtensionFinder* extension_finder,
- int* field_number, ExtensionInfo* extension,
- bool* was_packed_on_wire);
-
- // Returns true and fills extension if extension is found.
- // Note to support packed repeated field compatibility, it also fills whether
- // the tag on wire is packed, which can be different from
- // extension->is_packed (whether packed=true is specified).
- bool FindExtensionInfoFromFieldNumber(int wire_type, int field_number,
- ExtensionFinder* extension_finder,
- ExtensionInfo* extension,
- bool* was_packed_on_wire);
+ int* field_number, ExtensionInfo* extension);
// Parses a single extension from the input. The input should start out
// positioned immediately after the wire tag. This method is called in
- // ParseField() after field number and was_packed_on_wire is extracted from
- // the wire tag and ExtensionInfo is found by the field number.
+ // ParseField() after field number is extracted from the wire tag and
+ // ExtensionInfo is found by the field number.
bool ParseFieldWithExtensionInfo(int field_number,
- bool was_packed_on_wire,
const ExtensionInfo& extension,
io::CodedInputStream* input,
FieldSkipper* field_skipper);
// Like ParseField(), but this method may parse singular message extensions
// lazily depending on the value of FLAGS_eagerly_parse_message_sets.
- bool ParseFieldMaybeLazily(int wire_type, int field_number,
- io::CodedInputStream* input,
+ bool ParseFieldMaybeLazily(uint32 tag, io::CodedInputStream* input,
ExtensionFinder* extension_finder,
FieldSkipper* field_skipper);
@@ -587,6 +536,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
ExtensionFinder* extension_finder,
FieldSkipper* field_skipper);
+
// Hack: RepeatedPtrFieldBase declares ExtensionSet as a friend. This
// friendship should automatically extend to ExtensionSet::Extension, but
// unfortunately some older compilers (e.g. GCC 3.4.4) do not implement this
@@ -604,7 +554,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
// for 100 elements or more. Also, we want AppendToList() to order fields
// by field number.
std::map<int, Extension> extensions_;
- ::google::protobuf::Arena* arena_;
+
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionSet);
};
@@ -639,16 +589,6 @@ inline void ExtensionSet::AddString(int number, FieldType type,
// public:
// typedef ? ConstType;
// typedef ? MutableType;
-// // TypeTraits for singular fields and repeated fields will define the
-// // symbol "Singular" or "Repeated" respectively. These two symbols will
-// // be used in extension accessors to distinguish between singular
-// // extensions and repeated extensions. If the TypeTraits for the passed
-// // in extension doesn't have the expected symbol defined, it means the
-// // user is passing a repeated extension to a singular accessor, or the
-// // opposite. In that case the C++ compiler will generate an error
-// // message "no matching member function" to inform the user.
-// typedef ? Singular
-// typedef ? Repeated
//
// static inline ConstType Get(int number, const ExtensionSet& set);
// static inline void Set(int number, ConstType value, ExtensionSet* set);
@@ -687,8 +627,6 @@ template <typename Type>
class PrimitiveTypeTraits {
public:
typedef Type ConstType;
- typedef Type MutableType;
- typedef PrimitiveTypeTraits<Type> Singular;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value);
@@ -700,41 +638,11 @@ template <typename Type>
class RepeatedPrimitiveTypeTraits {
public:
typedef Type ConstType;
- typedef Type MutableType;
- typedef RepeatedPrimitiveTypeTraits<Type> Repeated;
-
- typedef RepeatedField<Type> RepeatedFieldType;
static inline Type Get(int number, const ExtensionSet& set, int index);
static inline void Set(int number, int index, Type value, ExtensionSet* set);
static inline void Add(int number, FieldType field_type,
bool is_packed, Type value, ExtensionSet* set);
-
- static inline const RepeatedField<ConstType>&
- GetRepeated(int number, const ExtensionSet& set);
- static inline RepeatedField<Type>*
- MutableRepeated(int number, FieldType field_type,
- bool is_packed, ExtensionSet* set);
-
- static const RepeatedFieldType* GetDefaultRepeatedField();
-};
-
-// Declared here so that this can be friended below.
-void InitializeDefaultRepeatedFields();
-void DestroyDefaultRepeatedFields();
-
-class LIBPROTOBUF_EXPORT RepeatedPrimitiveGenericTypeTraits {
- private:
- template<typename Type> friend class RepeatedPrimitiveTypeTraits;
- friend void InitializeDefaultRepeatedFields();
- friend void DestroyDefaultRepeatedFields();
- static const RepeatedField<int32>* default_repeated_field_int32_;
- static const RepeatedField<int64>* default_repeated_field_int64_;
- static const RepeatedField<uint32>* default_repeated_field_uint32_;
- static const RepeatedField<uint64>* default_repeated_field_uint64_;
- static const RepeatedField<double>* default_repeated_field_double_;
- static const RepeatedField<float>* default_repeated_field_float_;
- static const RepeatedField<bool>* default_repeated_field_bool_;
};
#define PROTOBUF_DEFINE_PRIMITIVE_TYPE(TYPE, METHOD) \
@@ -759,26 +667,6 @@ template<> inline void RepeatedPrimitiveTypeTraits<TYPE>::Add( \
int number, FieldType field_type, bool is_packed, \
TYPE value, ExtensionSet* set) { \
set->Add##METHOD(number, field_type, is_packed, value, NULL); \
-} \
-template<> inline const RepeatedField<TYPE>* \
- RepeatedPrimitiveTypeTraits<TYPE>::GetDefaultRepeatedField() { \
- return RepeatedPrimitiveGenericTypeTraits:: \
- default_repeated_field_##TYPE##_; \
-} \
-template<> inline const RepeatedField<TYPE>& \
- RepeatedPrimitiveTypeTraits<TYPE>::GetRepeated(int number, \
- const ExtensionSet& set) { \
- return *reinterpret_cast<const RepeatedField<TYPE>*>( \
- set.GetRawRepeatedField( \
- number, GetDefaultRepeatedField())); \
-} \
-template<> inline RepeatedField<TYPE>* \
- RepeatedPrimitiveTypeTraits<TYPE>::MutableRepeated(int number, \
- FieldType field_type, \
- bool is_packed, \
- ExtensionSet* set) { \
- return reinterpret_cast<RepeatedField<TYPE>*>( \
- set->MutableRawRepeatedField(number, field_type, is_packed, NULL)); \
}
PROTOBUF_DEFINE_PRIMITIVE_TYPE( int32, Int32)
@@ -799,7 +687,6 @@ class LIBPROTOBUF_EXPORT StringTypeTraits {
public:
typedef const string& ConstType;
typedef string* MutableType;
- typedef StringTypeTraits Singular;
static inline const string& Get(int number, const ExtensionSet& set,
ConstType default_value) {
@@ -819,9 +706,6 @@ class LIBPROTOBUF_EXPORT RepeatedStringTypeTraits {
public:
typedef const string& ConstType;
typedef string* MutableType;
- typedef RepeatedStringTypeTraits Repeated;
-
- typedef RepeatedPtrField<string> RepeatedFieldType;
static inline const string& Get(int number, const ExtensionSet& set,
int index) {
@@ -843,28 +727,6 @@ class LIBPROTOBUF_EXPORT RepeatedStringTypeTraits {
ExtensionSet* set) {
return set->AddString(number, field_type, NULL);
}
- static inline const RepeatedPtrField<string>&
- GetRepeated(int number, const ExtensionSet& set) {
- return *reinterpret_cast<const RepeatedPtrField<string>*>(
- set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
- }
-
- static inline RepeatedPtrField<string>*
- MutableRepeated(int number, FieldType field_type,
- bool is_packed, ExtensionSet* set) {
- return reinterpret_cast<RepeatedPtrField<string>*>(
- set->MutableRawRepeatedField(number, field_type,
- is_packed, NULL));
- }
-
- static const RepeatedFieldType* GetDefaultRepeatedField() {
- return default_repeated_field_;
- }
-
- private:
- friend void InitializeDefaultRepeatedFields();
- friend void DestroyDefaultRepeatedFields();
- static const RepeatedFieldType *default_repeated_field_;
};
// -------------------------------------------------------------------
@@ -876,8 +738,6 @@ template <typename Type, bool IsValid(int)>
class EnumTypeTraits {
public:
typedef Type ConstType;
- typedef Type MutableType;
- typedef EnumTypeTraits<Type, IsValid> Singular;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value) {
@@ -894,10 +754,6 @@ template <typename Type, bool IsValid(int)>
class RepeatedEnumTypeTraits {
public:
typedef Type ConstType;
- typedef Type MutableType;
- typedef RepeatedEnumTypeTraits<Type, IsValid> Repeated;
-
- typedef RepeatedField<Type> RepeatedFieldType;
static inline ConstType Get(int number, const ExtensionSet& set, int index) {
return static_cast<Type>(set.GetRepeatedEnum(number, index));
@@ -912,35 +768,6 @@ class RepeatedEnumTypeTraits {
GOOGLE_DCHECK(IsValid(value));
set->AddEnum(number, field_type, is_packed, value, NULL);
}
- static inline const RepeatedField<Type>& GetRepeated(int number,
- const ExtensionSet&
- set) {
- // Hack: the `Extension` struct stores a RepeatedField<int> for enums.
- // RepeatedField<int> cannot implicitly convert to RepeatedField<EnumType>
- // so we need to do some casting magic. See message.h for similar
- // contortions for non-extension fields.
- return *reinterpret_cast<const RepeatedField<Type>*>(
- set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
- }
-
- static inline RepeatedField<Type>* MutableRepeated(int number,
- FieldType field_type,
- bool is_packed,
- ExtensionSet* set) {
- return reinterpret_cast<RepeatedField<Type>*>(
- set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
- }
-
- static const RepeatedFieldType* GetDefaultRepeatedField() {
- // Hack: as noted above, repeated enum fields are internally stored as a
- // RepeatedField<int>. We need to be able to instantiate global static
- // objects to return as default (empty) repeated fields on non-existent
- // extensions. We would not be able to know a-priori all of the enum types
- // (values of |Type|) to instantiate all of these, so we just re-use int32's
- // default repeated field object.
- return reinterpret_cast<const RepeatedField<Type>*>(
- RepeatedPrimitiveTypeTraits<int32>::GetDefaultRepeatedField());
- }
};
// -------------------------------------------------------------------
@@ -954,7 +781,6 @@ class MessageTypeTraits {
public:
typedef const Type& ConstType;
typedef Type* MutableType;
- typedef MessageTypeTraits<Type> Singular;
static inline ConstType Get(int number, const ExtensionSet& set,
ConstType default_value) {
@@ -970,24 +796,18 @@ class MessageTypeTraits {
MutableType message, ExtensionSet* set) {
set->SetAllocatedMessage(number, field_type, NULL, message);
}
- static inline MutableType Release(int number, FieldType /* field_type */,
+ static inline MutableType Release(int number, FieldType field_type,
ExtensionSet* set) {
return static_cast<Type*>(set->ReleaseMessage(
number, Type::default_instance()));
}
};
-// forward declaration
-class RepeatedMessageGenericTypeTraits;
-
template <typename Type>
class RepeatedMessageTypeTraits {
public:
typedef const Type& ConstType;
typedef Type* MutableType;
- typedef RepeatedMessageTypeTraits<Type> Repeated;
-
- typedef RepeatedPtrField<Type> RepeatedFieldType;
static inline ConstType Get(int number, const ExtensionSet& set, int index) {
return static_cast<const Type&>(set.GetRepeatedMessage(number, index));
@@ -1000,47 +820,8 @@ class RepeatedMessageTypeTraits {
return static_cast<Type*>(
set->AddMessage(number, field_type, Type::default_instance(), NULL));
}
- static inline const RepeatedPtrField<Type>& GetRepeated(int number,
- const ExtensionSet&
- set) {
- // See notes above in RepeatedEnumTypeTraits::GetRepeated(): same
- // casting hack applies here, because a RepeatedPtrField<MessageLite>
- // cannot naturally become a RepeatedPtrType<Type> even though Type is
- // presumably a message. google::protobuf::Message goes through similar contortions
- // with a reinterpret_cast<>.
- return *reinterpret_cast<const RepeatedPtrField<Type>*>(
- set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
- }
- static inline RepeatedPtrField<Type>* MutableRepeated(int number,
- FieldType field_type,
- bool is_packed,
- ExtensionSet* set) {
- return reinterpret_cast<RepeatedPtrField<Type>*>(
- set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
- }
-
- static const RepeatedFieldType* GetDefaultRepeatedField();
};
-// This class exists only to hold a generic default empty repeated field for all
-// message-type repeated field extensions.
-class LIBPROTOBUF_EXPORT RepeatedMessageGenericTypeTraits {
- public:
- typedef RepeatedPtrField< ::google::protobuf::MessageLite*> RepeatedFieldType;
- private:
- template<typename Type> friend class RepeatedMessageTypeTraits;
- friend void InitializeDefaultRepeatedFields();
- friend void DestroyDefaultRepeatedFields();
- static const RepeatedFieldType* default_repeated_field_;
-};
-
-template<typename Type> inline
- const typename RepeatedMessageTypeTraits<Type>::RepeatedFieldType*
- RepeatedMessageTypeTraits<Type>::GetDefaultRepeatedField() {
- return reinterpret_cast<const RepeatedFieldType*>(
- RepeatedMessageGenericTypeTraits::default_repeated_field_);
-}
-
// -------------------------------------------------------------------
// ExtensionIdentifier
@@ -1123,7 +904,7 @@ class ExtensionIdentifier {
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Singular::ConstType GetExtension( \
+ inline typename _proto_TypeTraits::ConstType GetExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) const { \
return _proto_TypeTraits::Get(id.number(), _extensions_, \
@@ -1133,7 +914,7 @@ class ExtensionIdentifier {
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Singular::MutableType MutableExtension( \
+ inline typename _proto_TypeTraits::MutableType MutableExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
return _proto_TypeTraits::Mutable(id.number(), _field_type, \
@@ -1146,7 +927,7 @@ class ExtensionIdentifier {
inline void SetExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
- typename _proto_TypeTraits::Singular::ConstType value) { \
+ typename _proto_TypeTraits::ConstType value) { \
_proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_); \
} \
\
@@ -1156,14 +937,14 @@ class ExtensionIdentifier {
inline void SetAllocatedExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
- typename _proto_TypeTraits::Singular::MutableType value) { \
+ typename _proto_TypeTraits::MutableType value) { \
_proto_TypeTraits::SetAllocated(id.number(), _field_type, \
value, &_extensions_); \
} \
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Singular::MutableType ReleaseExtension( \
+ inline typename _proto_TypeTraits::MutableType ReleaseExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
return _proto_TypeTraits::Release(id.number(), _field_type, \
@@ -1174,7 +955,7 @@ class ExtensionIdentifier {
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Repeated::ConstType GetExtension( \
+ inline typename _proto_TypeTraits::ConstType GetExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
int index) const { \
@@ -1184,7 +965,7 @@ class ExtensionIdentifier {
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension( \
+ inline typename _proto_TypeTraits::MutableType MutableExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
int index) { \
@@ -1197,14 +978,14 @@ class ExtensionIdentifier {
inline void SetExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
- int index, typename _proto_TypeTraits::Repeated::ConstType value) { \
+ int index, typename _proto_TypeTraits::ConstType value) { \
_proto_TypeTraits::Set(id.number(), index, value, &_extensions_); \
} \
\
template <typename _proto_TypeTraits, \
::google::protobuf::internal::FieldType _field_type, \
bool _is_packed> \
- inline typename _proto_TypeTraits::Repeated::MutableType AddExtension( \
+ inline typename _proto_TypeTraits::MutableType AddExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id) { \
return _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_); \
@@ -1216,32 +997,9 @@ class ExtensionIdentifier {
inline void AddExtension( \
const ::google::protobuf::internal::ExtensionIdentifier< \
CLASSNAME, _proto_TypeTraits, _field_type, _is_packed>& id, \
- typename _proto_TypeTraits::Repeated::ConstType value) { \
+ typename _proto_TypeTraits::ConstType value) { \
_proto_TypeTraits::Add(id.number(), _field_type, _is_packed, \
value, &_extensions_); \
- } \
- \
- template <typename _proto_TypeTraits, \
- ::google::protobuf::internal::FieldType _field_type, \
- bool _is_packed> \
- inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType& \
- GetRepeatedExtension( \
- const ::google::protobuf::internal::ExtensionIdentifier< \
- CLASSNAME, _proto_TypeTraits, _field_type, \
- _is_packed>& id) const { \
- return _proto_TypeTraits::GetRepeated(id.number(), _extensions_); \
- } \
- \
- template <typename _proto_TypeTraits, \
- ::google::protobuf::internal::FieldType _field_type, \
- bool _is_packed> \
- inline typename _proto_TypeTraits::Repeated::RepeatedFieldType* \
- MutableRepeatedExtension( \
- const ::google::protobuf::internal::ExtensionIdentifier< \
- CLASSNAME, _proto_TypeTraits, _field_type, \
- _is_packed>& id) { \
- return _proto_TypeTraits::MutableRepeated(id.number(), _field_type, \
- _is_packed, &_extensions_); \
}
} // namespace internal
« no previous file with comments | « third_party/protobuf/src/google/protobuf/empty.pb.cc ('k') | third_party/protobuf/src/google/protobuf/extension_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698