Skip to content

Commit

Permalink
Integrated internal changes from Google
Browse files Browse the repository at this point in the history
This includes all internal changes from around May 20 to now.
  • Loading branch information
acozzette committed Jun 29, 2016
1 parent 97efdc3 commit 83b0738
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 4 deletions.
16 changes: 13 additions & 3 deletions google/protobuf/any.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ option objc_class_prefix = "GPB";
// foo = any.unpack(Foo.class);
// }
//
// Example 3: Pack and unpack a message in Python.
//
// foo = Foo(...)
// any = Any()
// any.Pack(foo)
// ...
// if any.Is(Foo.DESCRIPTOR):
// any.Unpack(foo)
// ...
//
// 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 '/'
Expand Down Expand Up @@ -104,10 +114,10 @@ message Any {
// A URL/resource name whose content describes the type of the
// serialized protocol buffer message.
//
// For URLs which use the schema `http`, `https`, or no schema, the
// For URLs which use the scheme `http`, `https`, or no scheme, the
// following restrictions and interpretations apply:
//
// * If no schema is provided, `https` is assumed.
// * If no scheme 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
Expand All @@ -120,7 +130,7 @@ message Any {
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Schemas other than `http`, `https` (or the empty schema) might be
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
//
string type_url = 1;
Expand Down
9 changes: 9 additions & 0 deletions google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ message FieldDescriptorProto {
// Describes a oneof.
message OneofDescriptorProto {
optional string name = 1;
optional OneofOptions options = 2;
}

// Describes an enum type.
Expand Down Expand Up @@ -538,6 +539,14 @@ message FieldOptions {
extensions 1000 to max;
}

message OneofOptions {
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;

// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}

message EnumOptions {

// Set this option to true to allow mapping different tag names to the same
Expand Down
52 changes: 52 additions & 0 deletions google/protobuf/field_mask.proto
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,58 @@ option java_generate_equals_and_hash = true;
// describe the updated values, the API ignores the values of all
// fields not covered by the mask.
//
// If a repeated field is specified for an update operation, the existing
// repeated values in the target resource will be overwritten by the new values.
// Note that a repeated field is only allowed in the last position of a field
// mask.
//
// If a sub-message is specified in the last position of the field mask for an
// update operation, then the existing sub-message in the target resource is
// overwritten. Given the target message:
//
// f {
// b {
// d : 1
// x : 2
// }
// c : 1
// }
//
// And an update message:
//
// f {
// b {
// d : 10
// }
// }
//
// then if the field mask is:
//
// paths: "f.b"
//
// then the result will be:
//
// f {
// b {
// d : 10
// }
// c : 1
// }
//
// However, if the update mask was:
//
// paths: "f.b.d"
//
// then the result would be:
//
// f {
// b {
// d : 10
// x : 2
// }
// c : 1
// }
//
// In order to reset a field's value to the default, the field must
// be in the mask and set to the default value in the provided resource.
// Hence, in order to reset all fields of a resource, provide a default
Expand Down
2 changes: 1 addition & 1 deletion google/protobuf/source_context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ option objc_class_prefix = "GPB";
// protobuf element, like the file in which it is defined.
message SourceContext {
// The path-qualified name of the .proto file that contained the associated
// protobuf element. For example: `"google/protobuf/source.proto"`.
// protobuf element. For example: `"google/protobuf/source_context.proto"`.
string file_name = 1;
}
1 change: 1 addition & 0 deletions google/protobuf/unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ message TestDeprecatedFields {
// that.
message ForeignMessage {
optional int32 c = 1;
optional int32 d = 2;
}

enum ForeignEnum {
Expand Down
9 changes: 9 additions & 0 deletions google/protobuf/unittest_custom_options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ extend google.protobuf.FieldOptions {
optional int32 field_opt2 = 7753913 [default=42];
}

extend google.protobuf.OneofOptions {
optional int32 oneof_opt1 = 7740111;
}

extend google.protobuf.EnumOptions {
optional sfixed32 enum_opt1 = 7753576;
}
Expand Down Expand Up @@ -100,6 +104,11 @@ message TestMessageWithCustomOptions {
optional string field1 = 1 [ctype=CORD,
(field_opt1)=8765432109];

oneof AnOneof {
option (oneof_opt1) = -99;
int32 oneof_field = 2;
}

enum AnEnum {
option (enum_opt1) = -789;

Expand Down
5 changes: 5 additions & 0 deletions google/protobuf/util/json_format_proto3.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import "google/protobuf/wrappers.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/unittest.proto";

enum EnumType {
FOO = 0;
Expand Down Expand Up @@ -174,3 +175,7 @@ message TestBoolValue {
message TestCustomJsonName {
int32 value = 1 [json_name = "@value"];
}

message TestExtensions {
.protobuf_unittest.TestAllExtensions extensions = 1;
}

0 comments on commit 83b0738

Please sign in to comment.