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

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

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 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/util/internal/proto_writer.h
diff --git a/third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h b/third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h
index e631e56f29c419e7711ceada95f24783235c8618..957565e745f575410b41cff9dd9dc5d7fa183703 100644
--- a/third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h
+++ b/third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h
@@ -106,10 +106,12 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter {
return RenderDataPiece(name, DataPiece(value));
}
virtual ProtoWriter* RenderString(StringPiece name, StringPiece value) {
- return RenderDataPiece(name, DataPiece(value));
+ return RenderDataPiece(name,
+ DataPiece(value, use_strict_base64_decoding()));
}
virtual ProtoWriter* RenderBytes(StringPiece name, StringPiece value) {
- return RenderDataPiece(name, DataPiece(value, false));
+ return RenderDataPiece(
+ name, DataPiece(value, false, use_strict_base64_decoding()));
}
virtual ProtoWriter* RenderNull(StringPiece name) {
return RenderDataPiece(name, DataPiece::NullData());
@@ -126,7 +128,7 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter {
}
// When true, we finished writing to output a complete message.
- bool done() const { return done_; }
+ bool done() { return done_; }
// Returns the proto stream object.
google::protobuf::io::CodedOutputStream* stream() { return stream_.get(); }
@@ -266,6 +268,19 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter {
// Returns true if the field is repeated.
bool IsRepeated(const google::protobuf::Field& field);
+ // Starts an object given the field and the enclosing type.
+ ProtoWriter* StartObjectField(const google::protobuf::Field& field,
+ const google::protobuf::Type& type);
+
+ // Starts a list given the field and the enclosing type.
+ ProtoWriter* StartListField(const google::protobuf::Field& field,
+ const google::protobuf::Type& type);
+
+ // Renders a primitve field given the field and the enclosing type.
+ ProtoWriter* RenderPrimitiveField(const google::protobuf::Field& field,
+ const google::protobuf::Type& type,
+ const DataPiece& value);
+
private:
// Variables for describing the structure of the input tree:
// master_type_: descriptor for the whole protobuf message.

Powered by Google App Engine
This is Rietveld 408576698