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

Unified Diff: third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years 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/util/internal/protostream_objectsource.h
diff --git a/third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h b/third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h
index d7d4347b3ac6ce023fe5915d1592cd04572ee9d8..88ca652b2da177aa6273de84a000f0d533b5caf9 100644
--- a/third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h
+++ b/third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h
@@ -117,6 +117,7 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
max_recursion_depth_ = max_depth;
}
+
protected:
// Writes a proto2 Message to the ObjectWriter. When the given end_tag is
// found this method will complete, allowing it to be used for parsing both
@@ -128,6 +129,28 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
bool include_start_and_end,
ObjectWriter* ow) const;
+ // Renders a repeating field (packed or unpacked). Returns the next tag after
+ // reading all sequential repeating elements. The caller should use this tag
+ // before reading more tags from the stream.
+ virtual util::StatusOr<uint32> RenderList(
+ const google::protobuf::Field* field, StringPiece name, uint32 list_tag,
+ ObjectWriter* ow) const;
+
+ // Looks up a field and verify its consistency with wire type in tag.
+ const google::protobuf::Field* FindAndVerifyField(
+ const google::protobuf::Type& type, uint32 tag) const;
+
+ // Renders a field value to the ObjectWriter.
+ util::Status RenderField(const google::protobuf::Field* field,
+ StringPiece field_name, ObjectWriter* ow) const;
+
+ // Reads field value according to Field spec in 'field' and returns the read
+ // value as string. This only works for primitive datatypes (no message
+ // types).
+ const string ReadFieldValueAsString(
+ const google::protobuf::Field& field) const;
+
+
private:
ProtoStreamObjectSource(google::protobuf::io::CodedInputStream* stream,
const TypeInfo* typeinfo,
@@ -137,19 +160,9 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
const google::protobuf::Type&,
StringPiece, ObjectWriter*);
- // Looks up a field and verify its consistency with wire type in tag.
- const google::protobuf::Field* FindAndVerifyField(
- const google::protobuf::Type& type, uint32 tag) const;
-
// TODO(skarvaje): Mark these methods as non-const as they modify internal
// state (stream_).
//
- // Renders a repeating field (packed or unpacked).
- // Returns the next tag after reading all sequential repeating elements. The
- // caller should use this tag before reading more tags from the stream.
- util::StatusOr<uint32> RenderList(const google::protobuf::Field* field,
- StringPiece name, uint32 list_tag,
- ObjectWriter* ow) const;
// Renders a NWP map.
// Returns the next tag after reading all map entries. The caller should use
// this tag before reading more tags from the stream.
@@ -233,10 +246,6 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
static void DeleteRendererMap();
static TypeRenderer* FindTypeRenderer(const string& type_url);
- // Renders a field value to the ObjectWriter.
- util::Status RenderField(const google::protobuf::Field* field,
- StringPiece field_name, ObjectWriter* ow) const;
-
// Same as above but renders all non-message field types. Callers don't call
// this function directly. They just use RenderField.
util::Status RenderNonMessageField(const google::protobuf::Field* field,
@@ -244,12 +253,6 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
ObjectWriter* ow) const;
- // Reads field value according to Field spec in 'field' and returns the read
- // value as string. This only works for primitive datatypes (no message
- // types).
- const string ReadFieldValueAsString(
- const google::protobuf::Field& field) const;
-
// Utility function to detect proto maps. The 'field' MUST be repeated.
bool IsMap(const google::protobuf::Field& field) const;
@@ -270,6 +273,7 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
// Type information for all the types used in the descriptor. Used to find
// google::protobuf::Type of nested messages/enums.
const TypeInfo* typeinfo_;
+
// Whether this class owns the typeinfo_ object. If true the typeinfo_ object
// should be deleted in the destructor.
bool own_typeinfo_;
@@ -287,6 +291,12 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectSource : public ObjectSource {
// Maximum allowed recursion depth.
int max_recursion_depth_;
+ // Whether to render unknown fields.
+ bool render_unknown_fields_;
+
+ // Whether to add trailing zeros for timestamp and duration.
+ bool add_trailing_zeros_for_timestamp_and_duration_;
+
GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoStreamObjectSource);
};

Powered by Google App Engine
This is Rietveld 408576698