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

Unified Diff: third_party/protobuf/src/google/protobuf/any.proto

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
« no previous file with comments | « third_party/protobuf/src/google/protobuf/any.cc ('k') | third_party/protobuf/src/google/protobuf/any.pb.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/src/google/protobuf/any.proto
diff --git a/third_party/protobuf/src/google/protobuf/any.proto b/third_party/protobuf/src/google/protobuf/any.proto
index e8a18bc35e0839cc2bdebb422e96d555b63176d8..45db6ede352bb2af940675b63476b15554309951 100644
--- a/third_party/protobuf/src/google/protobuf/any.proto
+++ b/third_party/protobuf/src/google/protobuf/any.proto
@@ -33,14 +33,43 @@ syntax = "proto3";
package google.protobuf;
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "github.com/golang/protobuf/ptypes/any";
option java_package = "com.google.protobuf";
option java_outer_classname = "AnyProto";
option java_multiple_files = true;
option java_generate_equals_and_hash = true;
option objc_class_prefix = "GPB";
-// `Any` contains an arbitrary serialized message along with a URL
-// that describes the type of the serialized message.
+// `Any` contains an arbitrary serialized protocol buffer message along with a
+// URL that describes the type of the serialized message.
+//
+// Protobuf library provides support to pack/unpack Any values in the form
+// of utility functions or additional generated methods of the Any type.
+//
+// Example 1: Pack and unpack a message in C++.
+//
+// Foo foo = ...;
+// Any any;
+// any.PackFrom(foo);
+// ...
+// if (any.UnpackTo(&foo)) {
+// ...
+// }
+//
+// Example 2: Pack and unpack a message in Java.
+//
+// Foo foo = ...;
+// Any any = Any.pack(foo);
+// ...
+// if (any.is(Foo.class)) {
+// foo = any.unpack(Foo.class);
+// }
+//
+// The pack methods provided by protobuf library will by default use
+// 'type.googleapis.com/full.type.name' as the type URL and the unpack
+// methods only use the fully qualified type name after the last '/'
+// in the type URL, for example "foo.bar.com/x/y.z" will yield type
+// name "y.z".
//
//
// JSON
@@ -73,7 +102,7 @@ option objc_class_prefix = "GPB";
//
message Any {
// A URL/resource name whose content describes the type of the
- // serialized message.
+ // serialized protocol buffer message.
//
// For URLs which use the schema `http`, `https`, or no schema, the
// following restrictions and interpretations apply:
@@ -81,6 +110,8 @@ message Any {
// * If no schema is provided, `https` is assumed.
// * The last segment of the URL's path must represent the fully
// qualified name of the type (as in `path/google.protobuf.Duration`).
+ // The name should be in a canonical form (e.g., leading "." is
+ // not accepted).
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
@@ -94,6 +125,6 @@ message Any {
//
string type_url = 1;
- // Must be valid serialized data of the above specified type.
+ // Must be a valid serialized protocol buffer of the above specified type.
bytes value = 2;
}
« no previous file with comments | « third_party/protobuf/src/google/protobuf/any.cc ('k') | third_party/protobuf/src/google/protobuf/any.pb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698