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

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 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/compiler/objectivec/objectivec_primitive_field.h
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum.h b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
similarity index 55%
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_enum.h
copy to third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
index 9a9e5742ac3b8590e2e2c00de5123e681a53494e..9bb793434c0b6e5708901da562013806cc9b544d 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum.h
+++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// http://code.google.com/p/protobuf/
+// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -28,59 +28,55 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Author: kenton@google.com (Kenton Varda)
-// Based on original Protocol Buffers design by
-// Sanjay Ghemawat, Jeff Dean, and others.
-
-#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__
-#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__
+#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__
+#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__
+#include <map>
#include <string>
-#include <vector>
-#include <google/protobuf/descriptor.h>
+#include <google/protobuf/compiler/objectivec/objectivec_field.h>
namespace google {
namespace protobuf {
- namespace io {
- class Printer; // printer.h
- }
-}
-
-namespace protobuf {
namespace compiler {
-namespace java {
+namespace objectivec {
-class EnumGenerator {
- public:
- explicit EnumGenerator(const EnumDescriptor* descriptor);
- ~EnumGenerator();
+class PrimitiveFieldGenerator : public SingleFieldGenerator {
+ friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field);
- void Generate(io::Printer* printer);
+ protected:
+ explicit PrimitiveFieldGenerator(const FieldDescriptor* descriptor);
+ virtual ~PrimitiveFieldGenerator();
private:
- const EnumDescriptor* descriptor_;
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator);
+};
- // The proto language allows multiple enum constants to have the same numeric
- // value. Java, however, does not allow multiple enum constants to be
- // considered equivalent. We treat the first defined constant for any
- // given numeric value as "canonical" and the rest as aliases of that
- // canonical value.
- vector<const EnumValueDescriptor*> canonical_values_;
+class PrimitiveObjFieldGenerator : public ObjCObjFieldGenerator {
+ friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field);
- struct Alias {
- const EnumValueDescriptor* value;
- const EnumValueDescriptor* canonical_value;
- };
- vector<Alias> aliases_;
+ protected:
+ explicit PrimitiveObjFieldGenerator(const FieldDescriptor* descriptor);
+ virtual ~PrimitiveObjFieldGenerator();
- bool CanUseEnumValues();
+ private:
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveObjFieldGenerator);
+};
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
+class RepeatedPrimitiveFieldGenerator : public RepeatedFieldGenerator {
+ friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field);
+
+ protected:
+ explicit RepeatedPrimitiveFieldGenerator(const FieldDescriptor* descriptor);
+ virtual ~RepeatedPrimitiveFieldGenerator();
+ virtual void FinishInitialization(void);
+
+ private:
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator);
};
-} // namespace java
+} // namespace objectivec
} // namespace compiler
} // namespace protobuf
-
} // namespace google
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_H__
+
+#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__

Powered by Google App Engine
This is Rietveld 408576698