Skip to content

Commit

Permalink
Merge pull request protocolbuffers#2403 from google/down-integrate-wi…
Browse files Browse the repository at this point in the history
…th-msvc-fix

Integrated internal changes from Google
  • Loading branch information
Adam Cozzette authored Nov 23, 2016
2 parents 5538f52 + a9f29a0 commit 0451d97
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 4 deletions.
1 change: 1 addition & 0 deletions google/protobuf/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ option java_package = "com.google.protobuf";
option java_outer_classname = "ApiProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option go_package = "google.golang.org/genproto/protobuf/api;api";

// Api is a light-weight descriptor for a protocol buffer service.
message Api {
Expand Down
18 changes: 15 additions & 3 deletions google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ message FieldDescriptorProto {
LABEL_OPTIONAL = 1;
LABEL_REQUIRED = 2;
LABEL_REPEATED = 3;
// TODO(sanjay): Should we add LABEL_MAP?
};

optional string name = 1;
Expand Down Expand Up @@ -431,13 +430,14 @@ message MessageOptions {
// parser.
optional bool map_entry = 7;

reserved 8; // javalite_serializable


// 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;

reserved 8; // javalite_serializable
}

message FieldOptions {
Expand Down Expand Up @@ -551,6 +551,7 @@ message EnumOptions {
// is a formalization for deprecating enums.
optional bool deprecated = 3 [default=false];


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

Expand Down Expand Up @@ -605,6 +606,17 @@ message MethodOptions {
// this is a formalization for deprecating methods.
optional bool deprecated = 33 [default=false];

// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
// or neither? HTTP based RPC implementation may choose GET verb for safe
// methods, and PUT verb for idempotent methods instead of the default POST.
enum IdempotencyLevel {
IDEMPOTENCY_UNKNOWN = 0;
NO_SIDE_EFFECTS = 1; // implies idempotent
IDEMPOTENT = 2; // idempotent, but may have side effects
}
optional IdempotencyLevel idempotency_level =
34 [default=IDEMPOTENCY_UNKNOWN];

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

Expand Down
1 change: 1 addition & 0 deletions google/protobuf/field_mask.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option java_package = "com.google.protobuf";
option java_outer_classname = "FieldMaskProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";

// `FieldMask` represents a set of symbolic field paths, for example:
//
Expand Down
2 changes: 1 addition & 1 deletion google/protobuf/map_proto2_unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

syntax = "proto2";

option cc_enable_arenas = true;

import "google/protobuf/unittest_import.proto";

Expand Down
1 change: 1 addition & 0 deletions google/protobuf/source_context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option java_package = "com.google.protobuf";
option java_outer_classname = "SourceContextProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option go_package = "google.golang.org/genproto/protobuf/source_context;source_context";

// `SourceContext` represents information about the source of a
// protobuf element, like the file in which it is defined.
Expand Down
1 change: 1 addition & 0 deletions google/protobuf/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ option java_package = "com.google.protobuf";
option java_outer_classname = "TypeProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option go_package = "google.golang.org/genproto/protobuf/ptype;ptype";

// A protocol buffer message type.
message Type {
Expand Down
31 changes: 31 additions & 0 deletions google/protobuf/unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -886,3 +886,34 @@ message TestJsonName {
optional int32 FIELD_NAME5 = 5;
optional int32 field_name6 = 6 [json_name = "@type"];
}

message TestHugeFieldNumbers {
optional int32 optional_int32 = 536870000;
optional int32 fixed_32 = 536870001;
repeated int32 repeated_int32 = 536870002 [packed = false];
repeated int32 packed_int32 = 536870003 [packed = true];

optional ForeignEnum optional_enum = 536870004;
optional string optional_string = 536870005;
optional bytes optional_bytes = 536870006;
optional ForeignMessage optional_message = 536870007;

optional group OptionalGroup = 536870008 {
optional int32 group_a = 536870009;
}

map<string, string> string_string_map = 536870010;

oneof oneof_field {
uint32 oneof_uint32 = 536870011;
TestAllTypes oneof_test_all_types = 536870012;
string oneof_string = 536870013;
bytes oneof_bytes = 536870014;
}

extensions 536860000 to 536869999;
}

extend TestHugeFieldNumbers {
optional TestAllTypes test_all_types = 536860000;
}
34 changes: 34 additions & 0 deletions google/protobuf/unittest_lite.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ message TestAllTypesLite {
bytes oneof_bytes = 114;
NestedMessage oneof_lazy_nested_message = 115 [lazy = true];
}

// Tests toString for non-repeated fields with a list suffix
optional int32 deceptively_named_list = 116;
}

message ForeignMessageLite {
Expand Down Expand Up @@ -405,3 +408,34 @@ message V2MessageLite {
required int32 int_field = 1;
optional V2EnumLite enum_field = 2 [ default = V2_FIRST ];
}

message TestHugeFieldNumbersLite {
optional int32 optional_int32 = 536870000;
optional int32 fixed_32 = 536870001;
repeated int32 repeated_int32 = 536870002 [packed = false];
repeated int32 packed_int32 = 536870003 [packed = true];

optional ForeignEnumLite optional_enum = 536870004;
optional string optional_string = 536870005;
optional bytes optional_bytes = 536870006;
optional ForeignMessageLite optional_message = 536870007;

optional group OptionalGroup = 536870008 {
optional int32 group_a = 536870009;
}

map<string, string> string_string_map = 536870010;

oneof oneof_field {
uint32 oneof_uint32 = 536870011;
TestAllTypesLite oneof_test_all_types = 536870012;
string oneof_string = 536870013;
bytes oneof_bytes = 536870014;
}

extensions 536860000 to 536869999;
}

extend TestHugeFieldNumbersLite {
optional TestAllTypesLite test_all_types_lite = 536860000;
}

0 comments on commit 0451d97

Please sign in to comment.