| Index: third_party/protobuf/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto
|
| diff --git a/third_party/protobuf/js/test2.proto b/third_party/protobuf/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto
|
| similarity index 69%
|
| copy from third_party/protobuf/js/test2.proto
|
| copy to third_party/protobuf/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto
|
| index 44e55effcb47e983729f41a0b95f3e0f20497c05..fa1762594e8960814d5ad052ded3a5b9520d4f6d 100644
|
| --- a/third_party/protobuf/js/test2.proto
|
| +++ b/third_party/protobuf/java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_embed_optimize_for.proto
|
| @@ -1,6 +1,6 @@
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// https://developers.google.com/protocol-buffers/
|
| +// http://code.google.com/p/protobuf/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -28,27 +28,23 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -syntax = "proto2";
|
| -
|
| -option java_package = "com.google.apps.jspb.proto";
|
| -option java_multiple_files = true;
|
| +// Author: kenton@google.com (Kenton Varda)
|
| +// Based on original Protocol Buffers design by
|
| +// Sanjay Ghemawat, Jeff Dean, and others.
|
| +//
|
| +// A proto file which imports a proto file that uses optimize_for = CODE_SIZE.
|
|
|
| -package jspb.test;
|
| +import "google/protobuf/unittest_optimize_for.proto";
|
|
|
| -message TestExtensionsMessage {
|
| - optional int32 intfield = 1;
|
| - extensions 100 to max;
|
| -}
|
| +package protobuf_unittest;
|
|
|
| -message ExtensionMessage {
|
| - extend TestExtensionsMessage {
|
| - optional ExtensionMessage ext_field = 100;
|
| - }
|
| - optional string ext1 = 1;
|
| -}
|
| +// We optimize for speed here, but we are importing a proto that is optimized
|
| +// for code size.
|
| +option optimize_for = SPEED;
|
|
|
| -// Floating extensions are only supported when generating a _lib.js library.
|
| -extend TestExtensionsMessage {
|
| - optional ExtensionMessage floating_msg_field = 101;
|
| - optional string floating_str_field = 102;
|
| +message TestEmbedOptimizedForSize {
|
| + // Test that embedding a message which has optimize_for = CODE_SIZE into
|
| + // one optimized for speed works.
|
| + optional TestOptimizedForSize optional_message = 1;
|
| + repeated TestOptimizedForSize repeated_message = 2;
|
| }
|
|
|