| OLD | NEW |
| (Empty) | |
| 1 diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn |
| 2 index e796f1f..727bf07 100644 |
| 3 --- a/third_party/protobuf/BUILD.gn |
| 4 +++ b/third_party/protobuf/BUILD.gn |
| 5 @@ -96,6 +96,7 @@ protobuf_lite_sources = [ |
| 6 "src/google/protobuf/stubs/time.h", |
| 7 "src/google/protobuf/stubs/type_traits.h", |
| 8 "src/google/protobuf/testing/googletest.h", |
| 9 + "src/google/protobuf/unknown_field_set.cc", |
| 10 "src/google/protobuf/unknown_field_set.h", |
| 11 "src/google/protobuf/wire_format_lite.cc", |
| 12 "src/google/protobuf/wire_format_lite.h", |
| 13 @@ -212,7 +213,6 @@ source_set("protobuf_full") { |
| 14 "src/google/protobuf/timestamp.pb.h", |
| 15 "src/google/protobuf/type.pb.cc", |
| 16 "src/google/protobuf/type.pb.h", |
| 17 - "src/google/protobuf/unknown_field_set.cc", |
| 18 "src/google/protobuf/util/field_comparator.cc", |
| 19 "src/google/protobuf/util/field_comparator.h", |
| 20 "src/google/protobuf/util/internal/constants.h", |
| 21 diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.
chromium |
| 22 index a3fb161..ec6f4ab 100644 |
| 23 --- a/third_party/protobuf/README.chromium |
| 24 +++ b/third_party/protobuf/README.chromium |
| 25 @@ -22,6 +22,9 @@ Steps used to create the current version: |
| 26 01: Miscellaneous build fixes to make the upstream sources compile. At this |
| 27 point you should be able to build the protobuf_* and protoc targets (but |
| 28 not necessarily anything depending on them). |
| 29 + 02: Add unknown field retention to protobuf_lite. This is a large and comple
x |
| 30 + patch which will likely require reworking to apply correctly. Based on |
| 31 + http://crrev.com/62331 and http://crrev.com/173228 . |
| 32 (3) Generate descriptor_pb2.py using something like the following steps. Make |
| 33 sure you've regenerated your buildfiles and will build protoc from the |
| 34 newly-modified sources above. |
| 35 diff --git a/third_party/protobuf/protobuf.gyp b/third_party/protobuf/protobuf.g
yp |
| 36 index 2f06845..363df49 100644 |
| 37 --- a/third_party/protobuf/protobuf.gyp |
| 38 +++ b/third_party/protobuf/protobuf.gyp |
| 39 @@ -160,7 +160,6 @@ |
| 40 'src/google/protobuf/timestamp.pb.h', |
| 41 'src/google/protobuf/type.pb.cc', |
| 42 'src/google/protobuf/type.pb.h', |
| 43 - 'src/google/protobuf/unknown_field_set.cc', |
| 44 'src/google/protobuf/util/field_comparator.cc', |
| 45 'src/google/protobuf/util/field_comparator.h', |
| 46 'src/google/protobuf/util/internal/constants.h', |
| 47 diff --git a/third_party/protobuf/protobuf_lite.gypi b/third_party/protobuf/prot
obuf_lite.gypi |
| 48 index 8a4f8de..ed110ef 100644 |
| 49 --- a/third_party/protobuf/protobuf_lite.gypi |
| 50 +++ b/third_party/protobuf/protobuf_lite.gypi |
| 51 @@ -80,6 +80,7 @@ |
| 52 'src/google/protobuf/stubs/time.h', |
| 53 'src/google/protobuf/stubs/type_traits.h', |
| 54 'src/google/protobuf/testing/googletest.h', |
| 55 + 'src/google/protobuf/unknown_field_set.cc', |
| 56 'src/google/protobuf/unknown_field_set.h', |
| 57 'src/google/protobuf/wire_format_lite.cc', |
| 58 'src/google/protobuf/wire_format_lite.h', |
| 59 diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_fiel
d.cc b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc |
| 60 index 965327b..8c21ed2 100644 |
| 61 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc |
| 62 +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc |
| 63 @@ -365,7 +365,7 @@ GenerateMergeFromCodedStreamWithPacking(io::Printer* printer
) const { |
| 64 " this->mutable_$name$())));\n"); |
| 65 } else if (UseUnknownFieldSet(descriptor_->file())) { |
| 66 printer->Print(variables_, |
| 67 - "DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveU
nknowns(\n" |
| 68 + "DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumPrese
rveUnknowns(\n" |
| 69 " input,\n" |
| 70 " $number$,\n" |
| 71 " $type$_IsValid,\n" |
| 72 diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h
b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h |
| 73 index 4bbf830..5029954 100644 |
| 74 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h |
| 75 +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h |
| 76 @@ -166,7 +166,8 @@ inline bool PreserveUnknownFields(const Descriptor* message)
{ |
| 77 // If PreserveUnknownFields() is false, this method will not be |
| 78 // used. |
| 79 inline bool UseUnknownFieldSet(const FileDescriptor* file) { |
| 80 - return file->options().optimize_for() != FileOptions::LITE_RUNTIME; |
| 81 + return file->options().optimize_for() != FileOptions::LITE_RUNTIME || |
| 82 + file->options().retain_unknown_fields(); |
| 83 } |
| 84 |
| 85 |
| 86 diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.c
c b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc |
| 87 index b0e3875..4909d0f 100644 |
| 88 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc |
| 89 +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc |
| 90 @@ -3116,7 +3116,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) { |
| 91 if (PreserveUnknownFields(descriptor_)) { |
| 92 if (UseUnknownFieldSet(descriptor_->file())) { |
| 93 printer->Print( |
| 94 - "DO_(::google::protobuf::internal::WireFormat::SkipField(\n" |
| 95 + "DO_(::google::protobuf::internal::WireFormatLite::SkipField(\n" |
| 96 " input, tag, mutable_unknown_fields()));\n"); |
| 97 } else { |
| 98 printer->Print( |
| 99 @@ -3209,7 +3209,7 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) { |
| 100 "classname", classname_); |
| 101 GOOGLE_CHECK(UseUnknownFieldSet(descriptor_->file())); |
| 102 printer->Print( |
| 103 - " ::google::protobuf::internal::WireFormat::SerializeUnknownMessageSetIt
ems(\n" |
| 104 + " ::google::protobuf::internal::WireFormatLite::SerializeUnknownMessageS
etItems(\n" |
| 105 " unknown_fields(), output);\n"); |
| 106 printer->Print( |
| 107 "}\n"); |
| 108 @@ -3249,7 +3249,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* print
er) { |
| 109 "classname", classname_); |
| 110 GOOGLE_CHECK(UseUnknownFieldSet(descriptor_->file())); |
| 111 printer->Print( |
| 112 - " target = ::google::protobuf::internal::WireFormat::\n" |
| 113 + " target = ::google::protobuf::internal::WireFormatLite::\n" |
| 114 " SerializeUnknownMessageSetItemsToArray(\n" |
| 115 " unknown_fields(), target);\n"); |
| 116 printer->Print( |
| 117 @@ -3319,11 +3319,11 @@ GenerateSerializeWithCachedSizesBody(io::Printer* printe
r, bool to_array) { |
| 118 if (to_array) { |
| 119 printer->Print( |
| 120 "target = " |
| 121 - "::google::protobuf::internal::WireFormat::SerializeUnknownFields
ToArray(\n" |
| 122 + "::google::protobuf::internal::WireFormatLite::SerializeUnknownFi
eldsToArray(\n" |
| 123 " unknown_fields(), target);\n"); |
| 124 } else { |
| 125 printer->Print( |
| 126 - "::google::protobuf::internal::WireFormat::SerializeUnknownFields(\n" |
| 127 + "::google::protobuf::internal::WireFormatLite::SerializeUnknownFields
(\n" |
| 128 " unknown_fields(), output);\n"); |
| 129 } |
| 130 printer->Outdent(); |
| 131 @@ -3386,7 +3386,7 @@ GenerateByteSize(io::Printer* printer) { |
| 132 GOOGLE_CHECK(UseUnknownFieldSet(descriptor_->file())); |
| 133 printer->Print( |
| 134 "if (_internal_metadata_.have_unknown_fields()) {\n" |
| 135 - " total_size += ::google::protobuf::internal::WireFormat::\n" |
| 136 + " total_size += ::google::protobuf::internal::WireFormatLite::\n" |
| 137 " ComputeUnknownMessageSetItemsSize(unknown_fields());\n" |
| 138 "}\n"); |
| 139 printer->Print( |
| 140 @@ -3607,7 +3607,7 @@ GenerateByteSize(io::Printer* printer) { |
| 141 printer->Print( |
| 142 "if (_internal_metadata_.have_unknown_fields()) {\n" |
| 143 " total_size +=\n" |
| 144 - " ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize
(\n" |
| 145 + " ::google::protobuf::internal::WireFormatLite::ComputeUnknownFields
Size(\n" |
| 146 " unknown_fields());\n" |
| 147 "}\n"); |
| 148 } else { |
| 149 diff --git a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc b/th
ird_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc |
| 150 index e7890fa..29e3590 100644 |
| 151 --- a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc |
| 152 +++ b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc |
| 153 @@ -320,7 +320,7 @@ bool CodeGeneratorRequest::MergePartialFromCodedStream( |
| 154 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 155 goto success; |
| 156 } |
| 157 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 158 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 159 input, tag, mutable_unknown_fields())); |
| 160 break; |
| 161 } |
| 162 @@ -365,7 +365,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( |
| 163 } |
| 164 |
| 165 if (_internal_metadata_.have_unknown_fields()) { |
| 166 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 167 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 168 unknown_fields(), output); |
| 169 } |
| 170 // @@protoc_insertion_point(serialize_end:google.protobuf.compiler.CodeGenera
torRequest) |
| 171 @@ -403,7 +403,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( |
| 172 } |
| 173 |
| 174 if (_internal_metadata_.have_unknown_fields()) { |
| 175 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 176 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 177 unknown_fields(), target); |
| 178 } |
| 179 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.C
odeGeneratorRequest) |
| 180 @@ -437,7 +437,7 @@ int CodeGeneratorRequest::ByteSize() const { |
| 181 |
| 182 if (_internal_metadata_.have_unknown_fields()) { |
| 183 total_size += |
| 184 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 185 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 186 unknown_fields()); |
| 187 } |
| 188 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 189 @@ -811,7 +811,7 @@ bool CodeGeneratorResponse_File::MergePartialFromCodedStream
( |
| 190 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 191 goto success; |
| 192 } |
| 193 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 194 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 195 input, tag, mutable_unknown_fields())); |
| 196 break; |
| 197 } |
| 198 @@ -860,7 +860,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes( |
| 199 } |
| 200 |
| 201 if (_internal_metadata_.have_unknown_fields()) { |
| 202 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 203 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 204 unknown_fields(), output); |
| 205 } |
| 206 // @@protoc_insertion_point(serialize_end:google.protobuf.compiler.CodeGenera
torResponse.File) |
| 207 @@ -903,7 +903,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes( |
| 208 } |
| 209 |
| 210 if (_internal_metadata_.have_unknown_fields()) { |
| 211 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 212 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 213 unknown_fields(), target); |
| 214 } |
| 215 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.C
odeGeneratorResponse.File) |
| 216 @@ -938,7 +938,7 @@ int CodeGeneratorResponse_File::ByteSize() const { |
| 217 } |
| 218 if (_internal_metadata_.have_unknown_fields()) { |
| 219 total_size += |
| 220 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 221 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 222 unknown_fields()); |
| 223 } |
| 224 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 225 @@ -1147,7 +1147,7 @@ bool CodeGeneratorResponse::MergePartialFromCodedStream( |
| 226 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 227 goto success; |
| 228 } |
| 229 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 230 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 231 input, tag, mutable_unknown_fields())); |
| 232 break; |
| 233 } |
| 234 @@ -1182,7 +1182,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes( |
| 235 } |
| 236 |
| 237 if (_internal_metadata_.have_unknown_fields()) { |
| 238 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 239 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 240 unknown_fields(), output); |
| 241 } |
| 242 // @@protoc_insertion_point(serialize_end:google.protobuf.compiler.CodeGenera
torResponse) |
| 243 @@ -1210,7 +1210,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes( |
| 244 } |
| 245 |
| 246 if (_internal_metadata_.have_unknown_fields()) { |
| 247 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 248 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 249 unknown_fields(), target); |
| 250 } |
| 251 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.compiler.C
odeGeneratorResponse) |
| 252 @@ -1237,7 +1237,7 @@ int CodeGeneratorResponse::ByteSize() const { |
| 253 |
| 254 if (_internal_metadata_.have_unknown_fields()) { |
| 255 total_size += |
| 256 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 257 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 258 unknown_fields()); |
| 259 } |
| 260 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 261 diff --git a/third_party/protobuf/src/google/protobuf/descriptor.cc b/third_part
y/protobuf/src/google/protobuf/descriptor.cc |
| 262 index 2855c37..36e42a6 100644 |
| 263 --- a/third_party/protobuf/src/google/protobuf/descriptor.cc |
| 264 +++ b/third_party/protobuf/src/google/protobuf/descriptor.cc |
| 265 @@ -5600,7 +5600,7 @@ bool DescriptorBuilder::OptionInterpreter::InterpretSingle
Option( |
| 266 io::StringOutputStream outstr( |
| 267 parent_unknown_fields->AddLengthDelimited((*iter)->number())); |
| 268 io::CodedOutputStream out(&outstr); |
| 269 - internal::WireFormat::SerializeUnknownFields(*unknown_fields, &out); |
| 270 + internal::WireFormatLite::SerializeUnknownFields(*unknown_fields, &out)
; |
| 271 GOOGLE_CHECK(!out.HadError()) |
| 272 << "Unexpected failure while serializing option submessage " |
| 273 << debug_msg_name << "\"."; |
| 274 diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc b/third_p
arty/protobuf/src/google/protobuf/descriptor.pb.cc |
| 275 index 5e7eeaa..b8e4406 100644 |
| 276 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc |
| 277 +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.cc |
| 278 @@ -311,10 +311,11 @@ void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2e
proto() { |
| 279 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _in
ternal_metadata_), |
| 280 -1); |
| 281 FileOptions_descriptor_ = file->message_type(9); |
| 282 - static const int FileOptions_offsets_[16] = { |
| 283 + static const int FileOptions_offsets_[17] = { |
| 284 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), |
| 285 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_clas
sname_), |
| 286 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_f
iles_), |
| 287 + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, retain_unknown_
fields_), |
| 288 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_e
quals_and_hash_), |
| 289 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_string_che
ck_utf8_), |
| 290 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), |
| 291 @@ -696,68 +697,69 @@ void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2epro
to() { |
| 292 "_type\030\002 \001(\t\022\023\n\013output_type\030\003 \001(\t\022/\n\007o
pti" |
| 293 "ons\030\004 \001(\0132\036.google.protobuf.MethodOption" |
| 294 "s\022\037\n\020client_streaming\030\005 \001(\010:\005false\022\037\n\020s
e" |
| 295 - "rver_streaming\030\006 \001(\010:\005false\"\252\005\n\013FileOpti" |
| 296 + "rver_streaming\030\006 \001(\010:\005false\"\320\005\n\013FileOpti" |
| 297 "ons\022\024\n\014java_package\030\001 \001(\t\022\034\n\024java_outer_" |
| 298 "classname\030\010 \001(\t\022\"\n\023java_multiple_files\030\n" |
| 299 - " \001(\010:\005false\022,\n\035java_generate_equals_and_" |
| 300 - "hash\030\024 \001(\010:\005false\022%\n\026java_string_check_u" |
| 301 - "tf8\030\033 \001(\010:\005false\022F\n\014optimize_for\030\t \001(\0162)" |
| 302 - ".google.protobuf.FileOptions.OptimizeMod" |
| 303 - "e:\005SPEED\022\022\n\ngo_package\030\013 \001(\t\022\"\n\023cc_gener" |
| 304 - "ic_services\030\020 \001(\010:\005false\022$\n\025java_generic" |
| 305 - "_services\030\021 \001(\010:\005false\022\"\n\023py_generic_ser" |
| 306 - "vices\030\022 \001(\010:\005false\022\031\n\ndeprecated\030\027 \001(\010:
\005" |
| 307 - "false\022\037\n\020cc_enable_arenas\030\037 \001(\010:\005false\022\031" |
| 308 - "\n\021objc_class_prefix\030$ \001(\t\022\030\n\020csharp_name" |
| 309 - "space\030% \001(\t\022\'\n\037javanano_use_deprecated_p" |
| 310 - "ackage\030& \001(\010\022C\n\024uninterpreted_option\030\347\007 " |
| 311 - "\003(\0132$.google.protobuf.UninterpretedOptio" |
| 312 - "n\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCODE_SIZ" |
| 313 - "E\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200
\200\002\"\346\001\n\016Mes" |
| 314 - "sageOptions\022&\n\027message_set_wire_format\030\001" |
| 315 - " \001(\010:\005false\022.\n\037no_standard_descriptor_ac" |
| 316 - "cessor\030\002 \001(\010:\005false\022\031\n\ndeprecated\030\003 \001(\010
:" |
| 317 - "\005false\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024uninterpret" |
| 318 + " \001(\010:\005false\022$\n\025retain_unknown_fields\030\014 \001" |
| 319 + "(\010:\005false\022,\n\035java_generate_equals_and_ha" |
| 320 + "sh\030\024 \001(\010:\005false\022%\n\026java_string_check_utf" |
| 321 + "8\030\033 \001(\010:\005false\022F\n\014optimize_for\030\t \001(\0162).g" |
| 322 + "oogle.protobuf.FileOptions.OptimizeMode:" |
| 323 + "\005SPEED\022\022\n\ngo_package\030\013 \001(\t\022\"\n\023cc_generic" |
| 324 + "_services\030\020 \001(\010:\005false\022$\n\025java_generic_s" |
| 325 + "ervices\030\021 \001(\010:\005false\022\"\n\023py_generic_servi" |
| 326 + "ces\030\022 \001(\010:\005false\022\031\n\ndeprecated\030\027 \001(\010:\0
05fa" |
| 327 + "lse\022\037\n\020cc_enable_arenas\030\037 \001(\010:\005false\022\031\n\02
1" |
| 328 + "objc_class_prefix\030$ \001(\t\022\030\n\020csharp_namesp" |
| 329 + "ace\030% \001(\t\022\'\n\037javanano_use_deprecated_pac" |
| 330 + "kage\030& \001(\010\022C\n\024uninterpreted_option\030\347\007 \003(" |
| 331 + "\0132$.google.protobuf.UninterpretedOption\"" |
| 332 + ":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCODE_SIZE\020" |
| 333 + "\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200\200\
002\"\346\001\n\016Messa" |
| 334 + "geOptions\022&\n\027message_set_wire_format\030\001 \001" |
| 335 + "(\010:\005false\022.\n\037no_standard_descriptor_acce" |
| 336 + "ssor\030\002 \001(\010:\005false\022\031\n\ndeprecated\030\003 \001(\010:\
005f" |
| 337 + "alse\022\021\n\tmap_entry\030\007 \001(\010\022C\n\024uninterpreted" |
| 338 + "_option\030\347\007 \003(\0132$.google.protobuf.Uninter" |
| 339 + "pretedOption*\t\010\350\007\020\200\200\200\200\002\"\230\003\n\014FieldOp
tions" |
| 340 + "\022:\n\005ctype\030\001 \001(\0162#.google.protobuf.FieldO" |
| 341 + "ptions.CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006" |
| 342 + "jstype\030\006 \001(\0162$.google.protobuf.FieldOpti" |
| 343 + "ons.JSType:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005fal" |
| 344 + "se\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\023\n\004weak\030
\n " |
| 345 + "\001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003(" |
| 346 + "\0132$.google.protobuf.UninterpretedOption\"" |
| 347 + "/\n\005CType\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n
\014STRING" |
| 348 + "_PIECE\020\002\"5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_" |
| 349 + "STRING\020\001\022\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200\2
00\002\"\215\001\n\013E" |
| 350 + "numOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031\n\ndepre" |
| 351 + "cated\030\003 \001(\010:\005false\022C\n\024uninterpreted_opti" |
| 352 + "on\030\347\007 \003(\0132$.google.protobuf.Uninterprete" |
| 353 + "dOption*\t\010\350\007\020\200\200\200\200\002\"}\n\020EnumValueOptions\02
2\031" |
| 354 + "\n\ndeprecated\030\001 \001(\010:\005false\022C\n\024uninterpret" |
| 355 "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" |
| 356 - "erpretedOption*\t\010\350\007\020\200\200\200\200\002\"\230\003\n\014Field
Optio" |
| 357 - "ns\022:\n\005ctype\030\001 \001(\0162#.google.protobuf.Fiel" |
| 358 - "dOptions.CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?" |
| 359 - "\n\006jstype\030\006 \001(\0162$.google.protobuf.FieldOp" |
| 360 - "tions.JSType:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005f" |
| 361 - "alse\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\023\n\004weak\0
30" |
| 362 - "\n \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 " |
| 363 - "\003(\0132$.google.protobuf.UninterpretedOptio" |
| 364 - "n\"/\n\005CType\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\02
0\n\014STRI" |
| 365 - "NG_PIECE\020\002\"5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJ" |
| 366 - "S_STRING\020\001\022\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200
\200\002\"\215\001\n" |
| 367 - "\013EnumOptions\022\023\n\013allow_alias\030\002 \001(\010\022\031\n\ndep" |
| 368 - "recated\030\003 \001(\010:\005false\022C\n\024uninterpreted_op" |
| 369 - "tion\030\347\007 \003(\0132$.google.protobuf.Uninterpre" |
| 370 - "tedOption*\t\010\350\007\020\200\200\200\200\002\"}\n\020EnumValueOptions" |
| 371 - "\022\031\n\ndeprecated\030\001 \001(\010:\005false\022C\n\024uninterpr" |
| 372 - "eted_option\030\347\007 \003(\0132$.google.protobuf.Uni" |
| 373 - "nterpretedOption*\t\010\350\007\020\200\200\200\200\002\"{\n\016ServiceOp" |
| 374 - "tions\022\031\n\ndeprecated\030! \001(\010:\005false\022C\n\024unin" |
| 375 - "terpreted_option\030\347\007 \003(\0132$.google.protobu" |
| 376 - "f.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"z\n\rMeth" |
| 377 - "odOptions\022\031\n\ndeprecated\030! \001(\010:\005false\022C\n\024" |
| 378 - "uninterpreted_option\030\347\007 \003(\0132$.google.pro" |
| 379 - "tobuf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\236\002
\n" |
| 380 - "\023UninterpretedOption\022;\n\004name\030\002 \003(\0132-.goo" |
| 381 - "gle.protobuf.UninterpretedOption.NamePar" |
| 382 - "t\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_" |
| 383 - "int_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 " |
| 384 - "\001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_
valu" |
| 385 - "e\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\01
0Name" |
| 386 - "Part\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030" |
| 387 - "\002 \002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \0
03" |
| 388 - "(\0132(.google.protobuf.SourceCodeInfo.Loca" |
| 389 - "tion\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\02
0\001\022\020\n\004s" |
| 390 - "pan\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \
001(\t\022" |
| 391 - "\031\n\021trailing_comments\030\004 \001(\t\022!\n\031leading_de" |
| 392 - "tached_comments\030\006 \003(\tB[\n\023com.google.prot" |
| 393 - "obufB\020DescriptorProtosH\001Z\ndescriptor\242\002\003G" |
| 394 - "PB\252\002\032Google.Protobuf.Reflection\260\002\001", 4994); |
| 395 + "erpretedOption*\t\010\350\007\020\200\200\200\200\002\"{\n\016ServiceOpti" |
| 396 + "ons\022\031\n\ndeprecated\030! \001(\010:\005false\022C\n\024uninte" |
| 397 + "rpreted_option\030\347\007 \003(\0132$.google.protobuf." |
| 398 + "UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"z\n\rMethod" |
| 399 + "Options\022\031\n\ndeprecated\030! \001(\010:\005false\022C\n\024un" |
| 400 + "interpreted_option\030\347\007 \003(\0132$.google.proto" |
| 401 + "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002\"\236\002\n
\023U" |
| 402 + "ninterpretedOption\022;\n\004name\030\002 \003(\0132-.googl" |
| 403 + "e.protobuf.UninterpretedOption.NamePart\022" |
| 404 + "\030\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_in" |
| 405 + "t_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(" |
| 406 + "\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_value
\030" |
| 407 + "\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\010Name
Pa" |
| 408 + "rt\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030\002
" |
| 409 + "\002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003(\0
13" |
| 410 + "2(.google.protobuf.SourceCodeInfo.Locati" |
| 411 + "on\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\
001\022\020\n\004spa" |
| 412 + "n\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \00
1(\t\022\031\n" |
| 413 + "\021trailing_comments\030\004 \001(\t\022!\n\031leading_deta" |
| 414 + "ched_comments\030\006 \003(\tB[\n\023com.google.protob" |
| 415 + "ufB\020DescriptorProtosH\001Z\ndescriptor\242\002\003GPB" |
| 416 + "\252\002\032Google.Protobuf.Reflection\260\002\001", 5032); |
| 417 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 418 "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); |
| 419 FileDescriptorSet::default_instance_ = new FileDescriptorSet(); |
| 420 @@ -928,7 +930,7 @@ bool FileDescriptorSet::MergePartialFromCodedStream( |
| 421 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 422 goto success; |
| 423 } |
| 424 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 425 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 426 input, tag, mutable_unknown_fields())); |
| 427 break; |
| 428 } |
| 429 @@ -953,7 +955,7 @@ void FileDescriptorSet::SerializeWithCachedSizes( |
| 430 } |
| 431 |
| 432 if (_internal_metadata_.have_unknown_fields()) { |
| 433 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 434 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 435 unknown_fields(), output); |
| 436 } |
| 437 // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorSet) |
| 438 @@ -970,7 +972,7 @@ void FileDescriptorSet::SerializeWithCachedSizes( |
| 439 } |
| 440 |
| 441 if (_internal_metadata_.have_unknown_fields()) { |
| 442 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 443 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 444 unknown_fields(), target); |
| 445 } |
| 446 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescri
ptorSet) |
| 447 @@ -990,7 +992,7 @@ int FileDescriptorSet::ByteSize() const { |
| 448 |
| 449 if (_internal_metadata_.have_unknown_fields()) { |
| 450 total_size += |
| 451 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 452 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 453 unknown_fields()); |
| 454 } |
| 455 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 456 @@ -1426,7 +1428,7 @@ bool FileDescriptorProto::MergePartialFromCodedStream( |
| 457 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 458 goto success; |
| 459 } |
| 460 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 461 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 462 input, tag, mutable_unknown_fields())); |
| 463 break; |
| 464 } |
| 465 @@ -1533,7 +1535,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( |
| 466 } |
| 467 |
| 468 if (_internal_metadata_.have_unknown_fields()) { |
| 469 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 470 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 471 unknown_fields(), output); |
| 472 } |
| 473 // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorProto
) |
| 474 @@ -1640,7 +1642,7 @@ void FileDescriptorProto::SerializeWithCachedSizes( |
| 475 } |
| 476 |
| 477 if (_internal_metadata_.have_unknown_fields()) { |
| 478 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 479 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 480 unknown_fields(), target); |
| 481 } |
| 482 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescri
ptorProto) |
| 483 @@ -1750,7 +1752,7 @@ int FileDescriptorProto::ByteSize() const { |
| 484 |
| 485 if (_internal_metadata_.have_unknown_fields()) { |
| 486 total_size += |
| 487 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 488 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 489 unknown_fields()); |
| 490 } |
| 491 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 492 @@ -2477,7 +2479,7 @@ bool DescriptorProto_ExtensionRange::MergePartialFromCoded
Stream( |
| 493 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 494 goto success; |
| 495 } |
| 496 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 497 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 498 input, tag, mutable_unknown_fields())); |
| 499 break; |
| 500 } |
| 501 @@ -2506,7 +2508,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSi
zes( |
| 502 } |
| 503 |
| 504 if (_internal_metadata_.have_unknown_fields()) { |
| 505 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 506 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 507 unknown_fields(), output); |
| 508 } |
| 509 // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.Ext
ensionRange) |
| 510 @@ -2526,7 +2528,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSi
zes( |
| 511 } |
| 512 |
| 513 if (_internal_metadata_.have_unknown_fields()) { |
| 514 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 515 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 516 unknown_fields(), target); |
| 517 } |
| 518 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Descriptor
Proto.ExtensionRange) |
| 519 @@ -2554,7 +2556,7 @@ int DescriptorProto_ExtensionRange::ByteSize() const { |
| 520 } |
| 521 if (_internal_metadata_.have_unknown_fields()) { |
| 522 total_size += |
| 523 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 524 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 525 unknown_fields()); |
| 526 } |
| 527 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 528 @@ -2760,7 +2762,7 @@ bool DescriptorProto_ReservedRange::MergePartialFromCodedS
tream( |
| 529 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 530 goto success; |
| 531 } |
| 532 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 533 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 534 input, tag, mutable_unknown_fields())); |
| 535 break; |
| 536 } |
| 537 @@ -2789,7 +2791,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSiz
es( |
| 538 } |
| 539 |
| 540 if (_internal_metadata_.have_unknown_fields()) { |
| 541 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 542 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 543 unknown_fields(), output); |
| 544 } |
| 545 // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.Res
ervedRange) |
| 546 @@ -2809,7 +2811,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSiz
es( |
| 547 } |
| 548 |
| 549 if (_internal_metadata_.have_unknown_fields()) { |
| 550 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 551 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 552 unknown_fields(), target); |
| 553 } |
| 554 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Descriptor
Proto.ReservedRange) |
| 555 @@ -2837,7 +2839,7 @@ int DescriptorProto_ReservedRange::ByteSize() const { |
| 556 } |
| 557 if (_internal_metadata_.have_unknown_fields()) { |
| 558 total_size += |
| 559 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 560 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 561 unknown_fields()); |
| 562 } |
| 563 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 564 @@ -3191,7 +3193,7 @@ bool DescriptorProto::MergePartialFromCodedStream( |
| 565 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 566 goto success; |
| 567 } |
| 568 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 569 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 570 input, tag, mutable_unknown_fields())); |
| 571 break; |
| 572 } |
| 573 @@ -3278,7 +3280,7 @@ void DescriptorProto::SerializeWithCachedSizes( |
| 574 } |
| 575 |
| 576 if (_internal_metadata_.have_unknown_fields()) { |
| 577 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 578 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 579 unknown_fields(), output); |
| 580 } |
| 581 // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto) |
| 582 @@ -3365,7 +3367,7 @@ void DescriptorProto::SerializeWithCachedSizes( |
| 583 } |
| 584 |
| 585 if (_internal_metadata_.have_unknown_fields()) { |
| 586 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 587 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 588 unknown_fields(), target); |
| 589 } |
| 590 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Descriptor
Proto) |
| 591 @@ -3456,7 +3458,7 @@ int DescriptorProto::ByteSize() const { |
| 592 |
| 593 if (_internal_metadata_.have_unknown_fields()) { |
| 594 total_size += |
| 595 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 596 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 597 unknown_fields()); |
| 598 } |
| 599 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 600 @@ -4380,7 +4382,7 @@ bool FieldDescriptorProto::MergePartialFromCodedStream( |
| 601 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 602 goto success; |
| 603 } |
| 604 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 605 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 606 input, tag, mutable_unknown_fields())); |
| 607 break; |
| 608 } |
| 609 @@ -4467,7 +4469,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes( |
| 610 } |
| 611 |
| 612 if (_internal_metadata_.have_unknown_fields()) { |
| 613 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 614 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 615 unknown_fields(), output); |
| 616 } |
| 617 // @@protoc_insertion_point(serialize_end:google.protobuf.FieldDescriptorProt
o) |
| 618 @@ -4550,7 +4552,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes( |
| 619 } |
| 620 |
| 621 if (_internal_metadata_.have_unknown_fields()) { |
| 622 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 623 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 624 unknown_fields(), target); |
| 625 } |
| 626 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldDescr
iptorProto) |
| 627 @@ -4625,7 +4627,7 @@ int FieldDescriptorProto::ByteSize() const { |
| 628 |
| 629 if (_internal_metadata_.have_unknown_fields()) { |
| 630 total_size += |
| 631 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 632 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 633 unknown_fields()); |
| 634 } |
| 635 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 636 @@ -5202,7 +5204,7 @@ bool OneofDescriptorProto::MergePartialFromCodedStream( |
| 637 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 638 goto success; |
| 639 } |
| 640 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 641 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 642 input, tag, mutable_unknown_fields())); |
| 643 break; |
| 644 } |
| 645 @@ -5231,7 +5233,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes( |
| 646 } |
| 647 |
| 648 if (_internal_metadata_.have_unknown_fields()) { |
| 649 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 650 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 651 unknown_fields(), output); |
| 652 } |
| 653 // @@protoc_insertion_point(serialize_end:google.protobuf.OneofDescriptorProt
o) |
| 654 @@ -5252,7 +5254,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes( |
| 655 } |
| 656 |
| 657 if (_internal_metadata_.have_unknown_fields()) { |
| 658 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 659 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 660 unknown_fields(), target); |
| 661 } |
| 662 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofDescr
iptorProto) |
| 663 @@ -5271,7 +5273,7 @@ int OneofDescriptorProto::ByteSize() const { |
| 664 |
| 665 if (_internal_metadata_.have_unknown_fields()) { |
| 666 total_size += |
| 667 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 668 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 669 unknown_fields()); |
| 670 } |
| 671 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 672 @@ -5549,7 +5551,7 @@ bool EnumDescriptorProto::MergePartialFromCodedStream( |
| 673 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 674 goto success; |
| 675 } |
| 676 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 677 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 678 input, tag, mutable_unknown_fields())); |
| 679 break; |
| 680 } |
| 681 @@ -5590,7 +5592,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes( |
| 682 } |
| 683 |
| 684 if (_internal_metadata_.have_unknown_fields()) { |
| 685 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 686 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 687 unknown_fields(), output); |
| 688 } |
| 689 // @@protoc_insertion_point(serialize_end:google.protobuf.EnumDescriptorProto
) |
| 690 @@ -5625,7 +5627,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes( |
| 691 } |
| 692 |
| 693 if (_internal_metadata_.have_unknown_fields()) { |
| 694 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 695 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 696 unknown_fields(), target); |
| 697 } |
| 698 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumDescri
ptorProto) |
| 699 @@ -5661,7 +5663,7 @@ int EnumDescriptorProto::ByteSize() const { |
| 700 |
| 701 if (_internal_metadata_.have_unknown_fields()) { |
| 702 total_size += |
| 703 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 704 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 705 unknown_fields()); |
| 706 } |
| 707 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 708 @@ -6021,7 +6023,7 @@ bool EnumValueDescriptorProto::MergePartialFromCodedStream
( |
| 709 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 710 goto success; |
| 711 } |
| 712 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 713 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 714 input, tag, mutable_unknown_fields())); |
| 715 break; |
| 716 } |
| 717 @@ -6061,7 +6063,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes( |
| 718 } |
| 719 |
| 720 if (_internal_metadata_.have_unknown_fields()) { |
| 721 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 722 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 723 unknown_fields(), output); |
| 724 } |
| 725 // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueDescriptor
Proto) |
| 726 @@ -6094,7 +6096,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes( |
| 727 } |
| 728 |
| 729 if (_internal_metadata_.have_unknown_fields()) { |
| 730 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 731 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 732 unknown_fields(), target); |
| 733 } |
| 734 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueD
escriptorProto) |
| 735 @@ -6129,7 +6131,7 @@ int EnumValueDescriptorProto::ByteSize() const { |
| 736 } |
| 737 if (_internal_metadata_.have_unknown_fields()) { |
| 738 total_size += |
| 739 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 740 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 741 unknown_fields()); |
| 742 } |
| 743 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 744 @@ -6485,7 +6487,7 @@ bool ServiceDescriptorProto::MergePartialFromCodedStream( |
| 745 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 746 goto success; |
| 747 } |
| 748 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 749 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 750 input, tag, mutable_unknown_fields())); |
| 751 break; |
| 752 } |
| 753 @@ -6526,7 +6528,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes( |
| 754 } |
| 755 |
| 756 if (_internal_metadata_.have_unknown_fields()) { |
| 757 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 758 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 759 unknown_fields(), output); |
| 760 } |
| 761 // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceDescriptorPr
oto) |
| 762 @@ -6561,7 +6563,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes( |
| 763 } |
| 764 |
| 765 if (_internal_metadata_.have_unknown_fields()) { |
| 766 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 767 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 768 unknown_fields(), target); |
| 769 } |
| 770 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceDes
criptorProto) |
| 771 @@ -6597,7 +6599,7 @@ int ServiceDescriptorProto::ByteSize() const { |
| 772 |
| 773 if (_internal_metadata_.have_unknown_fields()) { |
| 774 total_size += |
| 775 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 776 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 777 unknown_fields()); |
| 778 } |
| 779 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 780 @@ -7032,7 +7034,7 @@ bool MethodDescriptorProto::MergePartialFromCodedStream( |
| 781 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 782 goto success; |
| 783 } |
| 784 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 785 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 786 input, tag, mutable_unknown_fields())); |
| 787 break; |
| 788 } |
| 789 @@ -7097,7 +7099,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes( |
| 790 } |
| 791 |
| 792 if (_internal_metadata_.have_unknown_fields()) { |
| 793 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 794 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 795 unknown_fields(), output); |
| 796 } |
| 797 // @@protoc_insertion_point(serialize_end:google.protobuf.MethodDescriptorPro
to) |
| 798 @@ -7157,7 +7159,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes( |
| 799 } |
| 800 |
| 801 if (_internal_metadata_.have_unknown_fields()) { |
| 802 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 803 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 804 unknown_fields(), target); |
| 805 } |
| 806 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodDesc
riptorProto) |
| 807 @@ -7209,7 +7211,7 @@ int MethodDescriptorProto::ByteSize() const { |
| 808 } |
| 809 if (_internal_metadata_.have_unknown_fields()) { |
| 810 total_size += |
| 811 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 812 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 813 unknown_fields()); |
| 814 } |
| 815 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 816 @@ -7588,6 +7590,7 @@ const int FileOptions::OptimizeMode_ARRAYSIZE; |
| 817 const int FileOptions::kJavaPackageFieldNumber; |
| 818 const int FileOptions::kJavaOuterClassnameFieldNumber; |
| 819 const int FileOptions::kJavaMultipleFilesFieldNumber; |
| 820 +const int FileOptions::kRetainUnknownFieldsFieldNumber; |
| 821 const int FileOptions::kJavaGenerateEqualsAndHashFieldNumber; |
| 822 const int FileOptions::kJavaStringCheckUtf8FieldNumber; |
| 823 const int FileOptions::kOptimizeForFieldNumber; |
| 824 @@ -7626,6 +7629,7 @@ void FileOptions::SharedCtor() { |
| 825 java_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringA
lreadyInited()); |
| 826 java_outer_classname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmpt
yStringAlreadyInited()); |
| 827 java_multiple_files_ = false; |
| 828 + retain_unknown_fields_ = false; |
| 829 java_generate_equals_and_hash_ = false; |
| 830 java_string_check_utf8_ = false; |
| 831 optimize_for_ = 1; |
| 832 @@ -7815,6 +7819,21 @@ bool FileOptions::MergePartialFromCodedStream( |
| 833 } else { |
| 834 goto handle_unusual; |
| 835 } |
| 836 + if (input->ExpectTag(96)) goto parse_retain_unknown_fields; |
| 837 + break; |
| 838 + } |
| 839 + |
| 840 + // optional bool retain_unknown_fields = 12 [default = false]; |
| 841 + case 12: { |
| 842 + if (tag == 96) { |
| 843 + parse_retain_unknown_fields: |
| 844 + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 845 + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOO
L>( |
| 846 + input, &retain_unknown_fields_))); |
| 847 + set_has_retain_unknown_fields(); |
| 848 + } else { |
| 849 + goto handle_unusual; |
| 850 + } |
| 851 if (input->ExpectTag(128)) goto parse_cc_generic_services; |
| 852 break; |
| 853 } |
| 854 @@ -8002,7 +8021,7 @@ bool FileOptions::MergePartialFromCodedStream( |
| 855 mutable_unknown_fields())); |
| 856 continue; |
| 857 } |
| 858 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 859 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 860 input, tag, mutable_unknown_fields())); |
| 861 break; |
| 862 } |
| 863 @@ -8061,6 +8080,11 @@ void FileOptions::SerializeWithCachedSizes( |
| 864 11, this->go_package(), output); |
| 865 } |
| 866 |
| 867 + // optional bool retain_unknown_fields = 12 [default = false]; |
| 868 + if (has_retain_unknown_fields()) { |
| 869 + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->retain_un
known_fields(), output); |
| 870 + } |
| 871 + |
| 872 // optional bool cc_generic_services = 16 [default = false]; |
| 873 if (has_cc_generic_services()) { |
| 874 ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generi
c_services(), output); |
| 875 @@ -8132,7 +8156,7 @@ void FileOptions::SerializeWithCachedSizes( |
| 876 1000, 536870912, output); |
| 877 |
| 878 if (_internal_metadata_.have_unknown_fields()) { |
| 879 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 880 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 881 unknown_fields(), output); |
| 882 } |
| 883 // @@protoc_insertion_point(serialize_end:google.protobuf.FileOptions) |
| 884 @@ -8185,6 +8209,11 @@ void FileOptions::SerializeWithCachedSizes( |
| 885 11, this->go_package(), target); |
| 886 } |
| 887 |
| 888 + // optional bool retain_unknown_fields = 12 [default = false]; |
| 889 + if (has_retain_unknown_fields()) { |
| 890 + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12,
this->retain_unknown_fields(), target); |
| 891 + } |
| 892 + |
| 893 // optional bool cc_generic_services = 16 [default = false]; |
| 894 if (has_cc_generic_services()) { |
| 895 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16,
this->cc_generic_services(), target); |
| 896 @@ -8259,7 +8288,7 @@ void FileOptions::SerializeWithCachedSizes( |
| 897 1000, 536870912, target); |
| 898 |
| 899 if (_internal_metadata_.have_unknown_fields()) { |
| 900 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 901 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 902 unknown_fields(), target); |
| 903 } |
| 904 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileOption
s) |
| 905 @@ -8289,6 +8318,11 @@ int FileOptions::ByteSize() const { |
| 906 total_size += 1 + 1; |
| 907 } |
| 908 |
| 909 + // optional bool retain_unknown_fields = 12 [default = false]; |
| 910 + if (has_retain_unknown_fields()) { |
| 911 + total_size += 1 + 1; |
| 912 + } |
| 913 + |
| 914 // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 915 if (has_java_generate_equals_and_hash()) { |
| 916 total_size += 2 + 1; |
| 917 @@ -8371,7 +8405,7 @@ int FileOptions::ByteSize() const { |
| 918 |
| 919 if (_internal_metadata_.have_unknown_fields()) { |
| 920 total_size += |
| 921 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 922 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 923 unknown_fields()); |
| 924 } |
| 925 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 926 @@ -8407,6 +8441,9 @@ void FileOptions::MergeFrom(const FileOptions& from) { |
| 927 if (from.has_java_multiple_files()) { |
| 928 set_java_multiple_files(from.java_multiple_files()); |
| 929 } |
| 930 + if (from.has_retain_unknown_fields()) { |
| 931 + set_retain_unknown_fields(from.retain_unknown_fields()); |
| 932 + } |
| 933 if (from.has_java_generate_equals_and_hash()) { |
| 934 set_java_generate_equals_and_hash(from.java_generate_equals_and_hash()); |
| 935 } |
| 936 @@ -8482,6 +8519,7 @@ void FileOptions::InternalSwap(FileOptions* other) { |
| 937 java_package_.Swap(&other->java_package_); |
| 938 java_outer_classname_.Swap(&other->java_outer_classname_); |
| 939 std::swap(java_multiple_files_, other->java_multiple_files_); |
| 940 + std::swap(retain_unknown_fields_, other->retain_unknown_fields_); |
| 941 std::swap(java_generate_equals_and_hash_, other->java_generate_equals_and_has
h_); |
| 942 std::swap(java_string_check_utf8_, other->java_string_check_utf8_); |
| 943 std::swap(optimize_for_, other->optimize_for_); |
| 944 @@ -8642,15 +8680,39 @@ void FileOptions::clear_java_multiple_files() { |
| 945 // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multip
le_files) |
| 946 } |
| 947 |
| 948 +// optional bool retain_unknown_fields = 12 [default = false]; |
| 949 +bool FileOptions::has_retain_unknown_fields() const { |
| 950 + return (_has_bits_[0] & 0x00000008u) != 0; |
| 951 +} |
| 952 +void FileOptions::set_has_retain_unknown_fields() { |
| 953 + _has_bits_[0] |= 0x00000008u; |
| 954 +} |
| 955 +void FileOptions::clear_has_retain_unknown_fields() { |
| 956 + _has_bits_[0] &= ~0x00000008u; |
| 957 +} |
| 958 +void FileOptions::clear_retain_unknown_fields() { |
| 959 + retain_unknown_fields_ = false; |
| 960 + clear_has_retain_unknown_fields(); |
| 961 +} |
| 962 + bool FileOptions::retain_unknown_fields() const { |
| 963 + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.retain_unkn
own_fields) |
| 964 + return retain_unknown_fields_; |
| 965 +} |
| 966 + void FileOptions::set_retain_unknown_fields(bool value) { |
| 967 + set_has_retain_unknown_fields(); |
| 968 + retain_unknown_fields_ = value; |
| 969 + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.retain_unkn
own_fields) |
| 970 +} |
| 971 + |
| 972 // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 973 bool FileOptions::has_java_generate_equals_and_hash() const { |
| 974 - return (_has_bits_[0] & 0x00000008u) != 0; |
| 975 + return (_has_bits_[0] & 0x00000010u) != 0; |
| 976 } |
| 977 void FileOptions::set_has_java_generate_equals_and_hash() { |
| 978 - _has_bits_[0] |= 0x00000008u; |
| 979 + _has_bits_[0] |= 0x00000010u; |
| 980 } |
| 981 void FileOptions::clear_has_java_generate_equals_and_hash() { |
| 982 - _has_bits_[0] &= ~0x00000008u; |
| 983 + _has_bits_[0] &= ~0x00000010u; |
| 984 } |
| 985 void FileOptions::clear_java_generate_equals_and_hash() { |
| 986 java_generate_equals_and_hash_ = false; |
| 987 @@ -8668,13 +8730,13 @@ void FileOptions::clear_java_generate_equals_and_hash()
{ |
| 988 |
| 989 // optional bool java_string_check_utf8 = 27 [default = false]; |
| 990 bool FileOptions::has_java_string_check_utf8() const { |
| 991 - return (_has_bits_[0] & 0x00000010u) != 0; |
| 992 + return (_has_bits_[0] & 0x00000020u) != 0; |
| 993 } |
| 994 void FileOptions::set_has_java_string_check_utf8() { |
| 995 - _has_bits_[0] |= 0x00000010u; |
| 996 + _has_bits_[0] |= 0x00000020u; |
| 997 } |
| 998 void FileOptions::clear_has_java_string_check_utf8() { |
| 999 - _has_bits_[0] &= ~0x00000010u; |
| 1000 + _has_bits_[0] &= ~0x00000020u; |
| 1001 } |
| 1002 void FileOptions::clear_java_string_check_utf8() { |
| 1003 java_string_check_utf8_ = false; |
| 1004 @@ -8692,13 +8754,13 @@ void FileOptions::clear_java_string_check_utf8() { |
| 1005 |
| 1006 // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default
= SPEED]; |
| 1007 bool FileOptions::has_optimize_for() const { |
| 1008 - return (_has_bits_[0] & 0x00000020u) != 0; |
| 1009 + return (_has_bits_[0] & 0x00000040u) != 0; |
| 1010 } |
| 1011 void FileOptions::set_has_optimize_for() { |
| 1012 - _has_bits_[0] |= 0x00000020u; |
| 1013 + _has_bits_[0] |= 0x00000040u; |
| 1014 } |
| 1015 void FileOptions::clear_has_optimize_for() { |
| 1016 - _has_bits_[0] &= ~0x00000020u; |
| 1017 + _has_bits_[0] &= ~0x00000040u; |
| 1018 } |
| 1019 void FileOptions::clear_optimize_for() { |
| 1020 optimize_for_ = 1; |
| 1021 @@ -8717,13 +8779,13 @@ void FileOptions::clear_optimize_for() { |
| 1022 |
| 1023 // optional string go_package = 11; |
| 1024 bool FileOptions::has_go_package() const { |
| 1025 - return (_has_bits_[0] & 0x00000040u) != 0; |
| 1026 + return (_has_bits_[0] & 0x00000080u) != 0; |
| 1027 } |
| 1028 void FileOptions::set_has_go_package() { |
| 1029 - _has_bits_[0] |= 0x00000040u; |
| 1030 + _has_bits_[0] |= 0x00000080u; |
| 1031 } |
| 1032 void FileOptions::clear_has_go_package() { |
| 1033 - _has_bits_[0] &= ~0x00000040u; |
| 1034 + _has_bits_[0] &= ~0x00000080u; |
| 1035 } |
| 1036 void FileOptions::clear_go_package() { |
| 1037 go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyString
AlreadyInited()); |
| 1038 @@ -8770,13 +8832,13 @@ void FileOptions::clear_go_package() { |
| 1039 |
| 1040 // optional bool cc_generic_services = 16 [default = false]; |
| 1041 bool FileOptions::has_cc_generic_services() const { |
| 1042 - return (_has_bits_[0] & 0x00000080u) != 0; |
| 1043 + return (_has_bits_[0] & 0x00000100u) != 0; |
| 1044 } |
| 1045 void FileOptions::set_has_cc_generic_services() { |
| 1046 - _has_bits_[0] |= 0x00000080u; |
| 1047 + _has_bits_[0] |= 0x00000100u; |
| 1048 } |
| 1049 void FileOptions::clear_has_cc_generic_services() { |
| 1050 - _has_bits_[0] &= ~0x00000080u; |
| 1051 + _has_bits_[0] &= ~0x00000100u; |
| 1052 } |
| 1053 void FileOptions::clear_cc_generic_services() { |
| 1054 cc_generic_services_ = false; |
| 1055 @@ -8794,13 +8856,13 @@ void FileOptions::clear_cc_generic_services() { |
| 1056 |
| 1057 // optional bool java_generic_services = 17 [default = false]; |
| 1058 bool FileOptions::has_java_generic_services() const { |
| 1059 - return (_has_bits_[0] & 0x00000100u) != 0; |
| 1060 + return (_has_bits_[0] & 0x00000200u) != 0; |
| 1061 } |
| 1062 void FileOptions::set_has_java_generic_services() { |
| 1063 - _has_bits_[0] |= 0x00000100u; |
| 1064 + _has_bits_[0] |= 0x00000200u; |
| 1065 } |
| 1066 void FileOptions::clear_has_java_generic_services() { |
| 1067 - _has_bits_[0] &= ~0x00000100u; |
| 1068 + _has_bits_[0] &= ~0x00000200u; |
| 1069 } |
| 1070 void FileOptions::clear_java_generic_services() { |
| 1071 java_generic_services_ = false; |
| 1072 @@ -8818,13 +8880,13 @@ void FileOptions::clear_java_generic_services() { |
| 1073 |
| 1074 // optional bool py_generic_services = 18 [default = false]; |
| 1075 bool FileOptions::has_py_generic_services() const { |
| 1076 - return (_has_bits_[0] & 0x00000200u) != 0; |
| 1077 + return (_has_bits_[0] & 0x00000400u) != 0; |
| 1078 } |
| 1079 void FileOptions::set_has_py_generic_services() { |
| 1080 - _has_bits_[0] |= 0x00000200u; |
| 1081 + _has_bits_[0] |= 0x00000400u; |
| 1082 } |
| 1083 void FileOptions::clear_has_py_generic_services() { |
| 1084 - _has_bits_[0] &= ~0x00000200u; |
| 1085 + _has_bits_[0] &= ~0x00000400u; |
| 1086 } |
| 1087 void FileOptions::clear_py_generic_services() { |
| 1088 py_generic_services_ = false; |
| 1089 @@ -8842,13 +8904,13 @@ void FileOptions::clear_py_generic_services() { |
| 1090 |
| 1091 // optional bool deprecated = 23 [default = false]; |
| 1092 bool FileOptions::has_deprecated() const { |
| 1093 - return (_has_bits_[0] & 0x00000400u) != 0; |
| 1094 + return (_has_bits_[0] & 0x00000800u) != 0; |
| 1095 } |
| 1096 void FileOptions::set_has_deprecated() { |
| 1097 - _has_bits_[0] |= 0x00000400u; |
| 1098 + _has_bits_[0] |= 0x00000800u; |
| 1099 } |
| 1100 void FileOptions::clear_has_deprecated() { |
| 1101 - _has_bits_[0] &= ~0x00000400u; |
| 1102 + _has_bits_[0] &= ~0x00000800u; |
| 1103 } |
| 1104 void FileOptions::clear_deprecated() { |
| 1105 deprecated_ = false; |
| 1106 @@ -8866,13 +8928,13 @@ void FileOptions::clear_deprecated() { |
| 1107 |
| 1108 // optional bool cc_enable_arenas = 31 [default = false]; |
| 1109 bool FileOptions::has_cc_enable_arenas() const { |
| 1110 - return (_has_bits_[0] & 0x00000800u) != 0; |
| 1111 + return (_has_bits_[0] & 0x00001000u) != 0; |
| 1112 } |
| 1113 void FileOptions::set_has_cc_enable_arenas() { |
| 1114 - _has_bits_[0] |= 0x00000800u; |
| 1115 + _has_bits_[0] |= 0x00001000u; |
| 1116 } |
| 1117 void FileOptions::clear_has_cc_enable_arenas() { |
| 1118 - _has_bits_[0] &= ~0x00000800u; |
| 1119 + _has_bits_[0] &= ~0x00001000u; |
| 1120 } |
| 1121 void FileOptions::clear_cc_enable_arenas() { |
| 1122 cc_enable_arenas_ = false; |
| 1123 @@ -8890,13 +8952,13 @@ void FileOptions::clear_cc_enable_arenas() { |
| 1124 |
| 1125 // optional string objc_class_prefix = 36; |
| 1126 bool FileOptions::has_objc_class_prefix() const { |
| 1127 - return (_has_bits_[0] & 0x00001000u) != 0; |
| 1128 + return (_has_bits_[0] & 0x00002000u) != 0; |
| 1129 } |
| 1130 void FileOptions::set_has_objc_class_prefix() { |
| 1131 - _has_bits_[0] |= 0x00001000u; |
| 1132 + _has_bits_[0] |= 0x00002000u; |
| 1133 } |
| 1134 void FileOptions::clear_has_objc_class_prefix() { |
| 1135 - _has_bits_[0] &= ~0x00001000u; |
| 1136 + _has_bits_[0] &= ~0x00002000u; |
| 1137 } |
| 1138 void FileOptions::clear_objc_class_prefix() { |
| 1139 objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmpt
yStringAlreadyInited()); |
| 1140 @@ -8943,13 +9005,13 @@ void FileOptions::clear_objc_class_prefix() { |
| 1141 |
| 1142 // optional string csharp_namespace = 37; |
| 1143 bool FileOptions::has_csharp_namespace() const { |
| 1144 - return (_has_bits_[0] & 0x00002000u) != 0; |
| 1145 + return (_has_bits_[0] & 0x00004000u) != 0; |
| 1146 } |
| 1147 void FileOptions::set_has_csharp_namespace() { |
| 1148 - _has_bits_[0] |= 0x00002000u; |
| 1149 + _has_bits_[0] |= 0x00004000u; |
| 1150 } |
| 1151 void FileOptions::clear_has_csharp_namespace() { |
| 1152 - _has_bits_[0] &= ~0x00002000u; |
| 1153 + _has_bits_[0] &= ~0x00004000u; |
| 1154 } |
| 1155 void FileOptions::clear_csharp_namespace() { |
| 1156 csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmpty
StringAlreadyInited()); |
| 1157 @@ -8996,13 +9058,13 @@ void FileOptions::clear_csharp_namespace() { |
| 1158 |
| 1159 // optional bool javanano_use_deprecated_package = 38; |
| 1160 bool FileOptions::has_javanano_use_deprecated_package() const { |
| 1161 - return (_has_bits_[0] & 0x00004000u) != 0; |
| 1162 + return (_has_bits_[0] & 0x00008000u) != 0; |
| 1163 } |
| 1164 void FileOptions::set_has_javanano_use_deprecated_package() { |
| 1165 - _has_bits_[0] |= 0x00004000u; |
| 1166 + _has_bits_[0] |= 0x00008000u; |
| 1167 } |
| 1168 void FileOptions::clear_has_javanano_use_deprecated_package() { |
| 1169 - _has_bits_[0] &= ~0x00004000u; |
| 1170 + _has_bits_[0] &= ~0x00008000u; |
| 1171 } |
| 1172 void FileOptions::clear_javanano_use_deprecated_package() { |
| 1173 javanano_use_deprecated_package_ = false; |
| 1174 @@ -9241,7 +9303,7 @@ bool MessageOptions::MergePartialFromCodedStream( |
| 1175 mutable_unknown_fields())); |
| 1176 continue; |
| 1177 } |
| 1178 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1179 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1180 input, tag, mutable_unknown_fields())); |
| 1181 break; |
| 1182 } |
| 1183 @@ -9290,7 +9352,7 @@ void MessageOptions::SerializeWithCachedSizes( |
| 1184 1000, 536870912, output); |
| 1185 |
| 1186 if (_internal_metadata_.have_unknown_fields()) { |
| 1187 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1188 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1189 unknown_fields(), output); |
| 1190 } |
| 1191 // @@protoc_insertion_point(serialize_end:google.protobuf.MessageOptions) |
| 1192 @@ -9331,7 +9393,7 @@ void MessageOptions::SerializeWithCachedSizes( |
| 1193 1000, 536870912, target); |
| 1194 |
| 1195 if (_internal_metadata_.have_unknown_fields()) { |
| 1196 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1197 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1198 unknown_fields(), target); |
| 1199 } |
| 1200 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MessageOpt
ions) |
| 1201 @@ -9375,7 +9437,7 @@ int MessageOptions::ByteSize() const { |
| 1202 |
| 1203 if (_internal_metadata_.have_unknown_fields()) { |
| 1204 total_size += |
| 1205 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1206 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1207 unknown_fields()); |
| 1208 } |
| 1209 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1210 @@ -9877,7 +9939,7 @@ bool FieldOptions::MergePartialFromCodedStream( |
| 1211 mutable_unknown_fields())); |
| 1212 continue; |
| 1213 } |
| 1214 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1215 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1216 input, tag, mutable_unknown_fields())); |
| 1217 break; |
| 1218 } |
| 1219 @@ -9938,7 +10000,7 @@ void FieldOptions::SerializeWithCachedSizes( |
| 1220 1000, 536870912, output); |
| 1221 |
| 1222 if (_internal_metadata_.have_unknown_fields()) { |
| 1223 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1224 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1225 unknown_fields(), output); |
| 1226 } |
| 1227 // @@protoc_insertion_point(serialize_end:google.protobuf.FieldOptions) |
| 1228 @@ -9991,7 +10053,7 @@ void FieldOptions::SerializeWithCachedSizes( |
| 1229 1000, 536870912, target); |
| 1230 |
| 1231 if (_internal_metadata_.have_unknown_fields()) { |
| 1232 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1233 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1234 unknown_fields(), target); |
| 1235 } |
| 1236 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldOptio
ns) |
| 1237 @@ -10047,7 +10109,7 @@ int FieldOptions::ByteSize() const { |
| 1238 |
| 1239 if (_internal_metadata_.have_unknown_fields()) { |
| 1240 total_size += |
| 1241 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1242 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1243 unknown_fields()); |
| 1244 } |
| 1245 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1246 @@ -10480,7 +10542,7 @@ bool EnumOptions::MergePartialFromCodedStream( |
| 1247 mutable_unknown_fields())); |
| 1248 continue; |
| 1249 } |
| 1250 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1251 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1252 input, tag, mutable_unknown_fields())); |
| 1253 break; |
| 1254 } |
| 1255 @@ -10519,7 +10581,7 @@ void EnumOptions::SerializeWithCachedSizes( |
| 1256 1000, 536870912, output); |
| 1257 |
| 1258 if (_internal_metadata_.have_unknown_fields()) { |
| 1259 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1260 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1261 unknown_fields(), output); |
| 1262 } |
| 1263 // @@protoc_insertion_point(serialize_end:google.protobuf.EnumOptions) |
| 1264 @@ -10550,7 +10612,7 @@ void EnumOptions::SerializeWithCachedSizes( |
| 1265 1000, 536870912, target); |
| 1266 |
| 1267 if (_internal_metadata_.have_unknown_fields()) { |
| 1268 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1269 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1270 unknown_fields(), target); |
| 1271 } |
| 1272 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumOption
s) |
| 1273 @@ -10584,7 +10646,7 @@ int EnumOptions::ByteSize() const { |
| 1274 |
| 1275 if (_internal_metadata_.have_unknown_fields()) { |
| 1276 total_size += |
| 1277 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1278 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1279 unknown_fields()); |
| 1280 } |
| 1281 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1282 @@ -10874,7 +10936,7 @@ bool EnumValueOptions::MergePartialFromCodedStream( |
| 1283 mutable_unknown_fields())); |
| 1284 continue; |
| 1285 } |
| 1286 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1287 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1288 input, tag, mutable_unknown_fields())); |
| 1289 break; |
| 1290 } |
| 1291 @@ -10908,7 +10970,7 @@ void EnumValueOptions::SerializeWithCachedSizes( |
| 1292 1000, 536870912, output); |
| 1293 |
| 1294 if (_internal_metadata_.have_unknown_fields()) { |
| 1295 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1296 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1297 unknown_fields(), output); |
| 1298 } |
| 1299 // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueOptions) |
| 1300 @@ -10934,7 +10996,7 @@ void EnumValueOptions::SerializeWithCachedSizes( |
| 1301 1000, 536870912, target); |
| 1302 |
| 1303 if (_internal_metadata_.have_unknown_fields()) { |
| 1304 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1305 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1306 unknown_fields(), target); |
| 1307 } |
| 1308 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueO
ptions) |
| 1309 @@ -10961,7 +11023,7 @@ int EnumValueOptions::ByteSize() const { |
| 1310 |
| 1311 if (_internal_metadata_.have_unknown_fields()) { |
| 1312 total_size += |
| 1313 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1314 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1315 unknown_fields()); |
| 1316 } |
| 1317 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1318 @@ -11223,7 +11285,7 @@ bool ServiceOptions::MergePartialFromCodedStream( |
| 1319 mutable_unknown_fields())); |
| 1320 continue; |
| 1321 } |
| 1322 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1323 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1324 input, tag, mutable_unknown_fields())); |
| 1325 break; |
| 1326 } |
| 1327 @@ -11257,7 +11319,7 @@ void ServiceOptions::SerializeWithCachedSizes( |
| 1328 1000, 536870912, output); |
| 1329 |
| 1330 if (_internal_metadata_.have_unknown_fields()) { |
| 1331 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1332 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1333 unknown_fields(), output); |
| 1334 } |
| 1335 // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceOptions) |
| 1336 @@ -11283,7 +11345,7 @@ void ServiceOptions::SerializeWithCachedSizes( |
| 1337 1000, 536870912, target); |
| 1338 |
| 1339 if (_internal_metadata_.have_unknown_fields()) { |
| 1340 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1341 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1342 unknown_fields(), target); |
| 1343 } |
| 1344 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceOpt
ions) |
| 1345 @@ -11310,7 +11372,7 @@ int ServiceOptions::ByteSize() const { |
| 1346 |
| 1347 if (_internal_metadata_.have_unknown_fields()) { |
| 1348 total_size += |
| 1349 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1350 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1351 unknown_fields()); |
| 1352 } |
| 1353 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1354 @@ -11572,7 +11634,7 @@ bool MethodOptions::MergePartialFromCodedStream( |
| 1355 mutable_unknown_fields())); |
| 1356 continue; |
| 1357 } |
| 1358 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1359 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1360 input, tag, mutable_unknown_fields())); |
| 1361 break; |
| 1362 } |
| 1363 @@ -11606,7 +11668,7 @@ void MethodOptions::SerializeWithCachedSizes( |
| 1364 1000, 536870912, output); |
| 1365 |
| 1366 if (_internal_metadata_.have_unknown_fields()) { |
| 1367 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1368 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1369 unknown_fields(), output); |
| 1370 } |
| 1371 // @@protoc_insertion_point(serialize_end:google.protobuf.MethodOptions) |
| 1372 @@ -11632,7 +11694,7 @@ void MethodOptions::SerializeWithCachedSizes( |
| 1373 1000, 536870912, target); |
| 1374 |
| 1375 if (_internal_metadata_.have_unknown_fields()) { |
| 1376 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1377 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1378 unknown_fields(), target); |
| 1379 } |
| 1380 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodOpti
ons) |
| 1381 @@ -11659,7 +11721,7 @@ int MethodOptions::ByteSize() const { |
| 1382 |
| 1383 if (_internal_metadata_.have_unknown_fields()) { |
| 1384 total_size += |
| 1385 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1386 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1387 unknown_fields()); |
| 1388 } |
| 1389 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1390 @@ -11922,7 +11984,7 @@ bool UninterpretedOption_NamePart::MergePartialFromCoded
Stream( |
| 1391 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1392 goto success; |
| 1393 } |
| 1394 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1395 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1396 input, tag, mutable_unknown_fields())); |
| 1397 break; |
| 1398 } |
| 1399 @@ -11956,7 +12018,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSi
zes( |
| 1400 } |
| 1401 |
| 1402 if (_internal_metadata_.have_unknown_fields()) { |
| 1403 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1404 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1405 unknown_fields(), output); |
| 1406 } |
| 1407 // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption
.NamePart) |
| 1408 @@ -11982,7 +12044,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSi
zes( |
| 1409 } |
| 1410 |
| 1411 if (_internal_metadata_.have_unknown_fields()) { |
| 1412 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1413 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1414 unknown_fields(), target); |
| 1415 } |
| 1416 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Uninterpre
tedOption.NamePart) |
| 1417 @@ -12023,7 +12085,7 @@ int UninterpretedOption_NamePart::ByteSize() const { |
| 1418 } |
| 1419 if (_internal_metadata_.have_unknown_fields()) { |
| 1420 total_size += |
| 1421 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1422 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1423 unknown_fields()); |
| 1424 } |
| 1425 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1426 @@ -12335,7 +12397,7 @@ bool UninterpretedOption::MergePartialFromCodedStream( |
| 1427 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1428 goto success; |
| 1429 } |
| 1430 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1431 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1432 input, tag, mutable_unknown_fields())); |
| 1433 break; |
| 1434 } |
| 1435 @@ -12401,7 +12463,7 @@ void UninterpretedOption::SerializeWithCachedSizes( |
| 1436 } |
| 1437 |
| 1438 if (_internal_metadata_.have_unknown_fields()) { |
| 1439 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1440 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1441 unknown_fields(), output); |
| 1442 } |
| 1443 // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption
) |
| 1444 @@ -12462,7 +12524,7 @@ void UninterpretedOption::SerializeWithCachedSizes( |
| 1445 } |
| 1446 |
| 1447 if (_internal_metadata_.have_unknown_fields()) { |
| 1448 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1449 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1450 unknown_fields(), target); |
| 1451 } |
| 1452 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Uninterpre
tedOption) |
| 1453 @@ -12524,7 +12586,7 @@ int UninterpretedOption::ByteSize() const { |
| 1454 |
| 1455 if (_internal_metadata_.have_unknown_fields()) { |
| 1456 total_size += |
| 1457 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1458 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1459 unknown_fields()); |
| 1460 } |
| 1461 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1462 @@ -13161,7 +13223,7 @@ bool SourceCodeInfo_Location::MergePartialFromCodedStrea
m( |
| 1463 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1464 goto success; |
| 1465 } |
| 1466 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1467 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1468 input, tag, mutable_unknown_fields())); |
| 1469 break; |
| 1470 } |
| 1471 @@ -13230,7 +13292,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( |
| 1472 } |
| 1473 |
| 1474 if (_internal_metadata_.have_unknown_fields()) { |
| 1475 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1476 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1477 unknown_fields(), output); |
| 1478 } |
| 1479 // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo.Loca
tion) |
| 1480 @@ -13300,7 +13362,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes( |
| 1481 } |
| 1482 |
| 1483 if (_internal_metadata_.have_unknown_fields()) { |
| 1484 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1485 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1486 unknown_fields(), target); |
| 1487 } |
| 1488 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCode
Info.Location) |
| 1489 @@ -13369,7 +13431,7 @@ int SourceCodeInfo_Location::ByteSize() const { |
| 1490 |
| 1491 if (_internal_metadata_.have_unknown_fields()) { |
| 1492 total_size += |
| 1493 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1494 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1495 unknown_fields()); |
| 1496 } |
| 1497 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1498 @@ -13555,7 +13617,7 @@ bool SourceCodeInfo::MergePartialFromCodedStream( |
| 1499 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1500 goto success; |
| 1501 } |
| 1502 - DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1503 + DO_(::google::protobuf::internal::WireFormatLite::SkipField( |
| 1504 input, tag, mutable_unknown_fields())); |
| 1505 break; |
| 1506 } |
| 1507 @@ -13580,7 +13642,7 @@ void SourceCodeInfo::SerializeWithCachedSizes( |
| 1508 } |
| 1509 |
| 1510 if (_internal_metadata_.have_unknown_fields()) { |
| 1511 - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1512 + ::google::protobuf::internal::WireFormatLite::SerializeUnknownFields( |
| 1513 unknown_fields(), output); |
| 1514 } |
| 1515 // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo) |
| 1516 @@ -13597,7 +13659,7 @@ void SourceCodeInfo::SerializeWithCachedSizes( |
| 1517 } |
| 1518 |
| 1519 if (_internal_metadata_.have_unknown_fields()) { |
| 1520 - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsTo
Array( |
| 1521 + target = ::google::protobuf::internal::WireFormatLite::SerializeUnknownFiel
dsToArray( |
| 1522 unknown_fields(), target); |
| 1523 } |
| 1524 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCode
Info) |
| 1525 @@ -13617,7 +13679,7 @@ int SourceCodeInfo::ByteSize() const { |
| 1526 |
| 1527 if (_internal_metadata_.have_unknown_fields()) { |
| 1528 total_size += |
| 1529 - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1530 + ::google::protobuf::internal::WireFormatLite::ComputeUnknownFieldsSize( |
| 1531 unknown_fields()); |
| 1532 } |
| 1533 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1534 diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.h b/third_pa
rty/protobuf/src/google/protobuf/descriptor.pb.h |
| 1535 index 2aa076a..f9d21c7 100644 |
| 1536 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.h |
| 1537 +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.h |
| 1538 @@ -1908,6 +1908,13 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::p
rotobuf::Message { |
| 1539 bool java_multiple_files() const; |
| 1540 void set_java_multiple_files(bool value); |
| 1541 |
| 1542 + // optional bool retain_unknown_fields = 11 [default = false]; |
| 1543 + inline bool has_retain_unknown_fields() const; |
| 1544 + inline void clear_retain_unknown_fields(); |
| 1545 + static const int kRetainUnknownFieldsFieldNumber = 11; |
| 1546 + inline bool retain_unknown_fields() const; |
| 1547 + inline void set_retain_unknown_fields(bool value); |
| 1548 + |
| 1549 // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 1550 bool has_java_generate_equals_and_hash() const; |
| 1551 void clear_java_generate_equals_and_hash(); |
| 1552 @@ -2028,6 +2035,8 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::pr
otobuf::Message { |
| 1553 inline void clear_has_java_outer_classname(); |
| 1554 inline void set_has_java_multiple_files(); |
| 1555 inline void clear_has_java_multiple_files(); |
| 1556 + inline void set_has_retain_unknown_fields(); |
| 1557 + inline void clear_has_retain_unknown_fields(); |
| 1558 inline void set_has_java_generate_equals_and_hash(); |
| 1559 inline void clear_has_java_generate_equals_and_hash(); |
| 1560 inline void set_has_java_string_check_utf8(); |
| 1561 @@ -2061,6 +2070,7 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::pr
otobuf::Message { |
| 1562 ::google::protobuf::internal::ArenaStringPtr java_package_; |
| 1563 ::google::protobuf::internal::ArenaStringPtr java_outer_classname_; |
| 1564 bool java_multiple_files_; |
| 1565 + bool retain_unknown_fields_; |
| 1566 bool java_generate_equals_and_hash_; |
| 1567 bool java_string_check_utf8_; |
| 1568 bool cc_generic_services_; |
| 1569 @@ -5550,15 +5560,39 @@ inline void FileOptions::set_java_multiple_files(bool va
lue) { |
| 1570 // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multip
le_files) |
| 1571 } |
| 1572 |
| 1573 +// optional bool retain_unknown_fields = 12 [default = false]; |
| 1574 +inline bool FileOptions::has_retain_unknown_fields() const { |
| 1575 + return (_has_bits_[0] & 0x00000008u) != 0; |
| 1576 +} |
| 1577 +inline void FileOptions::set_has_retain_unknown_fields() { |
| 1578 + _has_bits_[0] |= 0x00000008u; |
| 1579 +} |
| 1580 +inline void FileOptions::clear_has_retain_unknown_fields() { |
| 1581 + _has_bits_[0] &= ~0x00000008u; |
| 1582 +} |
| 1583 +inline void FileOptions::clear_retain_unknown_fields() { |
| 1584 + retain_unknown_fields_ = false; |
| 1585 + clear_has_retain_unknown_fields(); |
| 1586 +} |
| 1587 +inline bool FileOptions::retain_unknown_fields() const { |
| 1588 + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.retain_unkn
own_fields) |
| 1589 + return retain_unknown_fields_; |
| 1590 +} |
| 1591 +inline void FileOptions::set_retain_unknown_fields(bool value) { |
| 1592 + set_has_retain_unknown_fields(); |
| 1593 + retain_unknown_fields_ = value; |
| 1594 + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.retain_unkn
own_fields) |
| 1595 +} |
| 1596 + |
| 1597 // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 1598 inline bool FileOptions::has_java_generate_equals_and_hash() const { |
| 1599 - return (_has_bits_[0] & 0x00000008u) != 0; |
| 1600 + return (_has_bits_[0] & 0x00000010u) != 0; |
| 1601 } |
| 1602 inline void FileOptions::set_has_java_generate_equals_and_hash() { |
| 1603 - _has_bits_[0] |= 0x00000008u; |
| 1604 + _has_bits_[0] |= 0x00000010u; |
| 1605 } |
| 1606 inline void FileOptions::clear_has_java_generate_equals_and_hash() { |
| 1607 - _has_bits_[0] &= ~0x00000008u; |
| 1608 + _has_bits_[0] &= ~0x00000010u; |
| 1609 } |
| 1610 inline void FileOptions::clear_java_generate_equals_and_hash() { |
| 1611 java_generate_equals_and_hash_ = false; |
| 1612 @@ -5576,13 +5610,13 @@ inline void FileOptions::set_java_generate_equals_and_ha
sh(bool value) { |
| 1613 |
| 1614 // optional bool java_string_check_utf8 = 27 [default = false]; |
| 1615 inline bool FileOptions::has_java_string_check_utf8() const { |
| 1616 - return (_has_bits_[0] & 0x00000010u) != 0; |
| 1617 + return (_has_bits_[0] & 0x00000020u) != 0; |
| 1618 } |
| 1619 inline void FileOptions::set_has_java_string_check_utf8() { |
| 1620 - _has_bits_[0] |= 0x00000010u; |
| 1621 + _has_bits_[0] |= 0x00000020u; |
| 1622 } |
| 1623 inline void FileOptions::clear_has_java_string_check_utf8() { |
| 1624 - _has_bits_[0] &= ~0x00000010u; |
| 1625 + _has_bits_[0] &= ~0x00000020u; |
| 1626 } |
| 1627 inline void FileOptions::clear_java_string_check_utf8() { |
| 1628 java_string_check_utf8_ = false; |
| 1629 @@ -5600,13 +5634,13 @@ inline void FileOptions::set_java_string_check_utf8(bool
value) { |
| 1630 |
| 1631 // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default
= SPEED]; |
| 1632 inline bool FileOptions::has_optimize_for() const { |
| 1633 - return (_has_bits_[0] & 0x00000020u) != 0; |
| 1634 + return (_has_bits_[0] & 0x00000040u) != 0; |
| 1635 } |
| 1636 inline void FileOptions::set_has_optimize_for() { |
| 1637 - _has_bits_[0] |= 0x00000020u; |
| 1638 + _has_bits_[0] |= 0x00000040u; |
| 1639 } |
| 1640 inline void FileOptions::clear_has_optimize_for() { |
| 1641 - _has_bits_[0] &= ~0x00000020u; |
| 1642 + _has_bits_[0] &= ~0x00000040u; |
| 1643 } |
| 1644 inline void FileOptions::clear_optimize_for() { |
| 1645 optimize_for_ = 1; |
| 1646 @@ -5625,13 +5659,13 @@ inline void FileOptions::set_optimize_for(::google::prot
obuf::FileOptions_Optimi |
| 1647 |
| 1648 // optional string go_package = 11; |
| 1649 inline bool FileOptions::has_go_package() const { |
| 1650 - return (_has_bits_[0] & 0x00000040u) != 0; |
| 1651 + return (_has_bits_[0] & 0x00000080u) != 0; |
| 1652 } |
| 1653 inline void FileOptions::set_has_go_package() { |
| 1654 - _has_bits_[0] |= 0x00000040u; |
| 1655 + _has_bits_[0] |= 0x00000080u; |
| 1656 } |
| 1657 inline void FileOptions::clear_has_go_package() { |
| 1658 - _has_bits_[0] &= ~0x00000040u; |
| 1659 + _has_bits_[0] &= ~0x00000080u; |
| 1660 } |
| 1661 inline void FileOptions::clear_go_package() { |
| 1662 go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyString
AlreadyInited()); |
| 1663 @@ -5678,13 +5712,13 @@ inline void FileOptions::set_allocated_go_package(::std:
:string* go_package) { |
| 1664 |
| 1665 // optional bool cc_generic_services = 16 [default = false]; |
| 1666 inline bool FileOptions::has_cc_generic_services() const { |
| 1667 - return (_has_bits_[0] & 0x00000080u) != 0; |
| 1668 + return (_has_bits_[0] & 0x00000100u) != 0; |
| 1669 } |
| 1670 inline void FileOptions::set_has_cc_generic_services() { |
| 1671 - _has_bits_[0] |= 0x00000080u; |
| 1672 + _has_bits_[0] |= 0x00000100u; |
| 1673 } |
| 1674 inline void FileOptions::clear_has_cc_generic_services() { |
| 1675 - _has_bits_[0] &= ~0x00000080u; |
| 1676 + _has_bits_[0] &= ~0x00000100u; |
| 1677 } |
| 1678 inline void FileOptions::clear_cc_generic_services() { |
| 1679 cc_generic_services_ = false; |
| 1680 @@ -5702,13 +5736,13 @@ inline void FileOptions::set_cc_generic_services(bool va
lue) { |
| 1681 |
| 1682 // optional bool java_generic_services = 17 [default = false]; |
| 1683 inline bool FileOptions::has_java_generic_services() const { |
| 1684 - return (_has_bits_[0] & 0x00000100u) != 0; |
| 1685 + return (_has_bits_[0] & 0x00000200u) != 0; |
| 1686 } |
| 1687 inline void FileOptions::set_has_java_generic_services() { |
| 1688 - _has_bits_[0] |= 0x00000100u; |
| 1689 + _has_bits_[0] |= 0x00000200u; |
| 1690 } |
| 1691 inline void FileOptions::clear_has_java_generic_services() { |
| 1692 - _has_bits_[0] &= ~0x00000100u; |
| 1693 + _has_bits_[0] &= ~0x00000200u; |
| 1694 } |
| 1695 inline void FileOptions::clear_java_generic_services() { |
| 1696 java_generic_services_ = false; |
| 1697 @@ -5726,13 +5760,13 @@ inline void FileOptions::set_java_generic_services(bool
value) { |
| 1698 |
| 1699 // optional bool py_generic_services = 18 [default = false]; |
| 1700 inline bool FileOptions::has_py_generic_services() const { |
| 1701 - return (_has_bits_[0] & 0x00000200u) != 0; |
| 1702 + return (_has_bits_[0] & 0x00000400u) != 0; |
| 1703 } |
| 1704 inline void FileOptions::set_has_py_generic_services() { |
| 1705 - _has_bits_[0] |= 0x00000200u; |
| 1706 + _has_bits_[0] |= 0x00000400u; |
| 1707 } |
| 1708 inline void FileOptions::clear_has_py_generic_services() { |
| 1709 - _has_bits_[0] &= ~0x00000200u; |
| 1710 + _has_bits_[0] &= ~0x00000400u; |
| 1711 } |
| 1712 inline void FileOptions::clear_py_generic_services() { |
| 1713 py_generic_services_ = false; |
| 1714 @@ -5750,13 +5784,13 @@ inline void FileOptions::set_py_generic_services(bool va
lue) { |
| 1715 |
| 1716 // optional bool deprecated = 23 [default = false]; |
| 1717 inline bool FileOptions::has_deprecated() const { |
| 1718 - return (_has_bits_[0] & 0x00000400u) != 0; |
| 1719 + return (_has_bits_[0] & 0x00000800u) != 0; |
| 1720 } |
| 1721 inline void FileOptions::set_has_deprecated() { |
| 1722 - _has_bits_[0] |= 0x00000400u; |
| 1723 + _has_bits_[0] |= 0x00000800u; |
| 1724 } |
| 1725 inline void FileOptions::clear_has_deprecated() { |
| 1726 - _has_bits_[0] &= ~0x00000400u; |
| 1727 + _has_bits_[0] &= ~0x00000800u; |
| 1728 } |
| 1729 inline void FileOptions::clear_deprecated() { |
| 1730 deprecated_ = false; |
| 1731 @@ -5774,13 +5808,13 @@ inline void FileOptions::set_deprecated(bool value) { |
| 1732 |
| 1733 // optional bool cc_enable_arenas = 31 [default = false]; |
| 1734 inline bool FileOptions::has_cc_enable_arenas() const { |
| 1735 - return (_has_bits_[0] & 0x00000800u) != 0; |
| 1736 + return (_has_bits_[0] & 0x00001000u) != 0; |
| 1737 } |
| 1738 inline void FileOptions::set_has_cc_enable_arenas() { |
| 1739 - _has_bits_[0] |= 0x00000800u; |
| 1740 + _has_bits_[0] |= 0x00001000u; |
| 1741 } |
| 1742 inline void FileOptions::clear_has_cc_enable_arenas() { |
| 1743 - _has_bits_[0] &= ~0x00000800u; |
| 1744 + _has_bits_[0] &= ~0x00001000u; |
| 1745 } |
| 1746 inline void FileOptions::clear_cc_enable_arenas() { |
| 1747 cc_enable_arenas_ = false; |
| 1748 @@ -5798,13 +5832,13 @@ inline void FileOptions::set_cc_enable_arenas(bool value
) { |
| 1749 |
| 1750 // optional string objc_class_prefix = 36; |
| 1751 inline bool FileOptions::has_objc_class_prefix() const { |
| 1752 - return (_has_bits_[0] & 0x00001000u) != 0; |
| 1753 + return (_has_bits_[0] & 0x00002000u) != 0; |
| 1754 } |
| 1755 inline void FileOptions::set_has_objc_class_prefix() { |
| 1756 - _has_bits_[0] |= 0x00001000u; |
| 1757 + _has_bits_[0] |= 0x00002000u; |
| 1758 } |
| 1759 inline void FileOptions::clear_has_objc_class_prefix() { |
| 1760 - _has_bits_[0] &= ~0x00001000u; |
| 1761 + _has_bits_[0] &= ~0x00002000u; |
| 1762 } |
| 1763 inline void FileOptions::clear_objc_class_prefix() { |
| 1764 objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmpt
yStringAlreadyInited()); |
| 1765 @@ -5851,13 +5885,13 @@ inline void FileOptions::set_allocated_objc_class_prefix
(::std::string* objc_cla |
| 1766 |
| 1767 // optional string csharp_namespace = 37; |
| 1768 inline bool FileOptions::has_csharp_namespace() const { |
| 1769 - return (_has_bits_[0] & 0x00002000u) != 0; |
| 1770 + return (_has_bits_[0] & 0x00004000u) != 0; |
| 1771 } |
| 1772 inline void FileOptions::set_has_csharp_namespace() { |
| 1773 - _has_bits_[0] |= 0x00002000u; |
| 1774 + _has_bits_[0] |= 0x00004000u; |
| 1775 } |
| 1776 inline void FileOptions::clear_has_csharp_namespace() { |
| 1777 - _has_bits_[0] &= ~0x00002000u; |
| 1778 + _has_bits_[0] &= ~0x00004000u; |
| 1779 } |
| 1780 inline void FileOptions::clear_csharp_namespace() { |
| 1781 csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmpty
StringAlreadyInited()); |
| 1782 diff --git a/third_party/protobuf/src/google/protobuf/descriptor.proto b/third_p
arty/protobuf/src/google/protobuf/descriptor.proto |
| 1783 index 9d3dd8f..4e38337 100644 |
| 1784 --- a/third_party/protobuf/src/google/protobuf/descriptor.proto |
| 1785 +++ b/third_party/protobuf/src/google/protobuf/descriptor.proto |
| 1786 @@ -299,6 +299,12 @@ message FileOptions { |
| 1787 // top-level extensions defined in the file. |
| 1788 optional bool java_multiple_files = 10 [default=false]; |
| 1789 |
| 1790 + // If set true, then code generators will store unknown fields so that |
| 1791 + // reserializing a message will retain them. This is the default behaviour |
| 1792 + // unless LITE_RUNTIME is specified. Therefore, this option only makes sense |
| 1793 + // when LITE_RUNTIME is in use. |
| 1794 + optional bool retain_unknown_fields = 12 [default=false]; |
| 1795 + |
| 1796 // If set true, then the Java code generator will generate equals() and |
| 1797 // hashCode() methods for all messages defined in the .proto file. |
| 1798 // - In the full runtime, this is purely a speed optimization, as the |
| 1799 diff --git a/third_party/protobuf/src/google/protobuf/extension_set.cc b/third_p
arty/protobuf/src/google/protobuf/extension_set.cc |
| 1800 index 649ae18..c315eca 100644 |
| 1801 --- a/third_party/protobuf/src/google/protobuf/extension_set.cc |
| 1802 +++ b/third_party/protobuf/src/google/protobuf/extension_set.cc |
| 1803 @@ -38,6 +38,7 @@ |
| 1804 #include <google/protobuf/extension_set.h> |
| 1805 #include <google/protobuf/message_lite.h> |
| 1806 #include <google/protobuf/io/coded_stream.h> |
| 1807 +#include <google/protobuf/io/zero_copy_stream_impl_lite.h> |
| 1808 #include <google/protobuf/wire_format_lite_inl.h> |
| 1809 #include <google/protobuf/repeated_field.h> |
| 1810 #include <google/protobuf/stubs/map_util.h> |
| 1811 @@ -1318,7 +1319,14 @@ bool ExtensionSet::ParseFieldWithExtensionInfo( |
| 1812 |
| 1813 bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input, |
| 1814 const MessageLite* containing_type) { |
| 1815 - FieldSkipper skipper; |
| 1816 + return ParseField(tag, input, containing_type, |
| 1817 + static_cast<UnknownFieldSet*>(NULL)); |
| 1818 +} |
| 1819 + |
| 1820 +bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input, |
| 1821 + const MessageLite* containing_type, |
| 1822 + UnknownFieldSet* unknown_fields) { |
| 1823 + FieldSkipper skipper(unknown_fields); |
| 1824 GeneratedExtensionFinder finder(containing_type); |
| 1825 return ParseField(tag, input, &finder, &skipper); |
| 1826 } |
| 1827 @@ -1332,14 +1340,137 @@ bool ExtensionSet::ParseField(uint32 tag, io::CodedInpu
tStream* input, |
| 1828 } |
| 1829 |
| 1830 // Defined in extension_set_heavy.cc. |
| 1831 -// bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input, |
| 1832 -// const MessageLite* containing_type, |
| 1833 -// UnknownFieldSet* unknown_fields) |
| 1834 +// bool ExtensionSet::ParseFieldHeavy(uint32 tag, io::CodedInputStream* input, |
| 1835 +// const Message* containing_type, |
| 1836 +// UnknownFieldSet* unknown_fields) |
| 1837 + |
| 1838 +bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 1839 + ExtensionFinder* extension_finder, |
| 1840 + FieldSkipper* field_skipper) { |
| 1841 + while (true) { |
| 1842 + const uint32 tag = input->ReadTag(); |
| 1843 + switch (tag) { |
| 1844 + case 0: |
| 1845 + return true; |
| 1846 + case WireFormatLite::kMessageSetItemStartTag: |
| 1847 + if (!ParseMessageSetItem(input, extension_finder, field_skipper)) { |
| 1848 + return false; |
| 1849 + } |
| 1850 + break; |
| 1851 + default: |
| 1852 + if (!ParseField(tag, input, extension_finder, field_skipper)) { |
| 1853 + return false; |
| 1854 + } |
| 1855 + break; |
| 1856 + } |
| 1857 + } |
| 1858 +} |
| 1859 + |
| 1860 +bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 1861 + const MessageLite* containing_type) { |
| 1862 + return ParseMessageSet(input, containing_type, |
| 1863 + static_cast<UnknownFieldSet*>(NULL)); |
| 1864 +} |
| 1865 + |
| 1866 +bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 1867 + const MessageLite* containing_type, |
| 1868 + UnknownFieldSet* unknown_fields) { |
| 1869 + FieldSkipper skipper(unknown_fields); |
| 1870 + GeneratedExtensionFinder finder(containing_type); |
| 1871 + return ParseMessageSet(input, &finder, &skipper); |
| 1872 +} |
| 1873 |
| 1874 // Defined in extension_set_heavy.cc. |
| 1875 -// bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 1876 -// const MessageLite* containing_type, |
| 1877 -// UnknownFieldSet* unknown_fields); |
| 1878 +// bool ExtensionSet::ParseMessageSetHeavy(io::CodedInputStream* input, |
| 1879 +// const Message* containing_type, |
| 1880 +// UnknownFieldSet* unknown_fields); |
| 1881 + |
| 1882 +bool ExtensionSet::ParseFieldMaybeLazily( |
| 1883 + int wire_type, int field_number, io::CodedInputStream* input, |
| 1884 + ExtensionFinder* extension_finder, |
| 1885 + FieldSkipper* field_skipper) { |
| 1886 + return ParseField(WireFormatLite::MakeTag( |
| 1887 + field_number, static_cast<WireFormatLite::WireType>(wire_type)), |
| 1888 + input, extension_finder, field_skipper); |
| 1889 +} |
| 1890 + |
| 1891 +bool ExtensionSet::ParseMessageSetItem(io::CodedInputStream* input, |
| 1892 + ExtensionFinder* extension_finder, |
| 1893 + FieldSkipper* field_skipper) { |
| 1894 + // TODO(kenton): It would be nice to share code between this and |
| 1895 + // WireFormatLite::ParseAndMergeMessageSetItem(), but I think the |
| 1896 + // differences would be hard to factor out. |
| 1897 + |
| 1898 + // This method parses a group which should contain two fields: |
| 1899 + // required int32 type_id = 2; |
| 1900 + // required data message = 3; |
| 1901 + |
| 1902 + uint32 last_type_id = 0; |
| 1903 + |
| 1904 + // If we see message data before the type_id, we'll append it to this so |
| 1905 + // we can parse it later. |
| 1906 + string message_data; |
| 1907 + |
| 1908 + while (true) { |
| 1909 + const uint32 tag = input->ReadTag(); |
| 1910 + if (tag == 0) return false; |
| 1911 + |
| 1912 + switch (tag) { |
| 1913 + case WireFormatLite::kMessageSetTypeIdTag: { |
| 1914 + uint32 type_id; |
| 1915 + if (!input->ReadVarint32(&type_id)) return false; |
| 1916 + last_type_id = type_id; |
| 1917 + |
| 1918 + if (!message_data.empty()) { |
| 1919 + // We saw some message data before the type_id. Have to parse it |
| 1920 + // now. |
| 1921 + io::CodedInputStream sub_input( |
| 1922 + reinterpret_cast<const uint8*>(message_data.data()), |
| 1923 + message_data.size()); |
| 1924 + if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 1925 + last_type_id, &sub_input, |
| 1926 + extension_finder, field_skipper)) { |
| 1927 + return false; |
| 1928 + } |
| 1929 + message_data.clear(); |
| 1930 + } |
| 1931 + |
| 1932 + break; |
| 1933 + } |
| 1934 + |
| 1935 + case WireFormatLite::kMessageSetMessageTag: { |
| 1936 + if (last_type_id == 0) { |
| 1937 + // We haven't seen a type_id yet. Append this data to message_data. |
| 1938 + string temp; |
| 1939 + uint32 length; |
| 1940 + if (!input->ReadVarint32(&length)) return false; |
| 1941 + if (!input->ReadString(&temp, length)) return false; |
| 1942 + io::StringOutputStream output_stream(&message_data); |
| 1943 + io::CodedOutputStream coded_output(&output_stream); |
| 1944 + coded_output.WriteVarint32(length); |
| 1945 + coded_output.WriteString(temp); |
| 1946 + } else { |
| 1947 + // Already saw type_id, so we can parse this directly. |
| 1948 + if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 1949 + last_type_id, input, |
| 1950 + extension_finder, field_skipper)) { |
| 1951 + return false; |
| 1952 + } |
| 1953 + } |
| 1954 + |
| 1955 + break; |
| 1956 + } |
| 1957 + |
| 1958 + case WireFormatLite::kMessageSetItemEndTag: { |
| 1959 + return true; |
| 1960 + } |
| 1961 + |
| 1962 + default: { |
| 1963 + if (!field_skipper->SkipField(input, tag)) return false; |
| 1964 + } |
| 1965 + } |
| 1966 + } |
| 1967 +} |
| 1968 |
| 1969 void ExtensionSet::SerializeWithCachedSizes( |
| 1970 int start_field_number, int end_field_number, |
| 1971 diff --git a/third_party/protobuf/src/google/protobuf/extension_set.h b/third_pa
rty/protobuf/src/google/protobuf/extension_set.h |
| 1972 index c371e01..25acee7 100644 |
| 1973 --- a/third_party/protobuf/src/google/protobuf/extension_set.h |
| 1974 +++ b/third_party/protobuf/src/google/protobuf/extension_set.h |
| 1975 @@ -138,9 +138,6 @@ class LIBPROTOBUF_EXPORT GeneratedExtensionFinder : public E
xtensionFinder { |
| 1976 const MessageLite* containing_type_; |
| 1977 }; |
| 1978 |
| 1979 -// A FieldSkipper used for parsing MessageSet. |
| 1980 -class MessageSetFieldSkipper; |
| 1981 - |
| 1982 // Note: extension_set_heavy.cc defines DescriptorPoolExtensionFinder for |
| 1983 // finding extensions from a DescriptorPool. |
| 1984 |
| 1985 @@ -366,25 +363,31 @@ class LIBPROTOBUF_EXPORT ExtensionSet { |
| 1986 bool ParseField(uint32 tag, io::CodedInputStream* input, |
| 1987 const MessageLite* containing_type); |
| 1988 bool ParseField(uint32 tag, io::CodedInputStream* input, |
| 1989 - const Message* containing_type, |
| 1990 + const MessageLite* containing_type, |
| 1991 UnknownFieldSet* unknown_fields); |
| 1992 bool ParseField(uint32 tag, io::CodedInputStream* input, |
| 1993 const MessageLite* containing_type, |
| 1994 io::CodedOutputStream* unknown_fields); |
| 1995 + bool ParseFieldHeavy(uint32 tag, io::CodedInputStream* input, |
| 1996 + const Message* containing_type, |
| 1997 + UnknownFieldSet* unknown_fields); |
| 1998 |
| 1999 // Parse an entire message in MessageSet format. Such messages have no |
| 2000 // fields, only extensions. |
| 2001 bool ParseMessageSet(io::CodedInputStream* input, |
| 2002 ExtensionFinder* extension_finder, |
| 2003 - MessageSetFieldSkipper* field_skipper); |
| 2004 + FieldSkipper* field_skipper); |
| 2005 |
| 2006 // Specific versions for lite or full messages (constructs the appropriate |
| 2007 // FieldSkipper automatically). |
| 2008 bool ParseMessageSet(io::CodedInputStream* input, |
| 2009 const MessageLite* containing_type); |
| 2010 bool ParseMessageSet(io::CodedInputStream* input, |
| 2011 - const Message* containing_type, |
| 2012 + const MessageLite* containing_type, |
| 2013 UnknownFieldSet* unknown_fields); |
| 2014 + bool ParseMessageSetHeavy(io::CodedInputStream* input, |
| 2015 + const Message* containing_type, |
| 2016 + UnknownFieldSet* unknown_fields); |
| 2017 |
| 2018 // Write all extension fields with field numbers in the range |
| 2019 // [start_field_number, end_field_number) |
| 2020 @@ -571,7 +574,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet { |
| 2021 bool ParseFieldMaybeLazily(int wire_type, int field_number, |
| 2022 io::CodedInputStream* input, |
| 2023 ExtensionFinder* extension_finder, |
| 2024 - MessageSetFieldSkipper* field_skipper); |
| 2025 + FieldSkipper* field_skipper); |
| 2026 |
| 2027 // Gets the extension with the given number, creating it if it does not |
| 2028 // already exist. Returns true if the extension did not already exist. |
| 2029 @@ -582,7 +585,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet { |
| 2030 // tag has been read. |
| 2031 bool ParseMessageSetItem(io::CodedInputStream* input, |
| 2032 ExtensionFinder* extension_finder, |
| 2033 - MessageSetFieldSkipper* field_skipper); |
| 2034 + FieldSkipper* field_skipper); |
| 2035 |
| 2036 // Hack: RepeatedPtrFieldBase declares ExtensionSet as a friend. This |
| 2037 // friendship should automatically extend to ExtensionSet::Extension, but |
| 2038 diff --git a/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc b/t
hird_party/protobuf/src/google/protobuf/extension_set_heavy.cc |
| 2039 index 330bd82..58f742b 100644 |
| 2040 --- a/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc |
| 2041 +++ b/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc |
| 2042 @@ -48,30 +48,6 @@ namespace google { |
| 2043 namespace protobuf { |
| 2044 namespace internal { |
| 2045 |
| 2046 -// A FieldSkipper used to store unknown MessageSet fields into UnknownFieldSet. |
| 2047 -class MessageSetFieldSkipper |
| 2048 - : public UnknownFieldSetFieldSkipper { |
| 2049 - public: |
| 2050 - explicit MessageSetFieldSkipper(UnknownFieldSet* unknown_fields) |
| 2051 - : UnknownFieldSetFieldSkipper(unknown_fields) {} |
| 2052 - virtual ~MessageSetFieldSkipper() {} |
| 2053 - |
| 2054 - virtual bool SkipMessageSetField(io::CodedInputStream* input, |
| 2055 - int field_number); |
| 2056 -}; |
| 2057 -bool MessageSetFieldSkipper::SkipMessageSetField( |
| 2058 - io::CodedInputStream* input, int field_number) { |
| 2059 - uint32 length; |
| 2060 - if (!input->ReadVarint32(&length)) return false; |
| 2061 - if (unknown_fields_ == NULL) { |
| 2062 - return input->Skip(length); |
| 2063 - } else { |
| 2064 - return input->ReadString( |
| 2065 - unknown_fields_->AddLengthDelimited(field_number), length); |
| 2066 - } |
| 2067 -} |
| 2068 - |
| 2069 - |
| 2070 // Implementation of ExtensionFinder which finds extensions in a given |
| 2071 // DescriptorPool, using the given MessageFactory to construct sub-objects. |
| 2072 // This class is implemented in extension_set_heavy.cc. |
| 2073 @@ -274,10 +250,10 @@ bool DescriptorPoolExtensionFinder::Find(int number, Exten
sionInfo* output) { |
| 2074 } |
| 2075 } |
| 2076 |
| 2077 -bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input, |
| 2078 - const Message* containing_type, |
| 2079 - UnknownFieldSet* unknown_fields) { |
| 2080 - UnknownFieldSetFieldSkipper skipper(unknown_fields); |
| 2081 +bool ExtensionSet::ParseFieldHeavy(uint32 tag, io::CodedInputStream* input, |
| 2082 + const Message* containing_type, |
| 2083 + UnknownFieldSet* unknown_fields) { |
| 2084 + FieldSkipper skipper(unknown_fields); |
| 2085 if (input->GetExtensionPool() == NULL) { |
| 2086 GeneratedExtensionFinder finder(containing_type); |
| 2087 return ParseField(tag, input, &finder, &skipper); |
| 2088 @@ -289,10 +265,10 @@ bool ExtensionSet::ParseField(uint32 tag, io::CodedInputSt
ream* input, |
| 2089 } |
| 2090 } |
| 2091 |
| 2092 -bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 2093 - const Message* containing_type, |
| 2094 - UnknownFieldSet* unknown_fields) { |
| 2095 - MessageSetFieldSkipper skipper(unknown_fields); |
| 2096 +bool ExtensionSet::ParseMessageSetHeavy(io::CodedInputStream* input, |
| 2097 + const Message* containing_type, |
| 2098 + UnknownFieldSet* unknown_fields) { |
| 2099 + FieldSkipper skipper(unknown_fields); |
| 2100 if (input->GetExtensionPool() == NULL) { |
| 2101 GeneratedExtensionFinder finder(containing_type); |
| 2102 return ParseMessageSet(input, &finder, &skipper); |
| 2103 @@ -541,122 +517,6 @@ uint8* ExtensionSet::Extension::SerializeMessageSetItemWit
hCachedSizesToArray( |
| 2104 } |
| 2105 |
| 2106 |
| 2107 -bool ExtensionSet::ParseFieldMaybeLazily( |
| 2108 - int wire_type, int field_number, io::CodedInputStream* input, |
| 2109 - ExtensionFinder* extension_finder, |
| 2110 - MessageSetFieldSkipper* field_skipper) { |
| 2111 - return ParseField(WireFormatLite::MakeTag( |
| 2112 - field_number, static_cast<WireFormatLite::WireType>(wire_type)), |
| 2113 - input, extension_finder, field_skipper); |
| 2114 -} |
| 2115 - |
| 2116 -bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 2117 - ExtensionFinder* extension_finder, |
| 2118 - MessageSetFieldSkipper* field_skipper) { |
| 2119 - while (true) { |
| 2120 - const uint32 tag = input->ReadTag(); |
| 2121 - switch (tag) { |
| 2122 - case 0: |
| 2123 - return true; |
| 2124 - case WireFormatLite::kMessageSetItemStartTag: |
| 2125 - if (!ParseMessageSetItem(input, extension_finder, field_skipper)) { |
| 2126 - return false; |
| 2127 - } |
| 2128 - break; |
| 2129 - default: |
| 2130 - if (!ParseField(tag, input, extension_finder, field_skipper)) { |
| 2131 - return false; |
| 2132 - } |
| 2133 - break; |
| 2134 - } |
| 2135 - } |
| 2136 -} |
| 2137 - |
| 2138 -bool ExtensionSet::ParseMessageSet(io::CodedInputStream* input, |
| 2139 - const MessageLite* containing_type) { |
| 2140 - MessageSetFieldSkipper skipper(NULL); |
| 2141 - GeneratedExtensionFinder finder(containing_type); |
| 2142 - return ParseMessageSet(input, &finder, &skipper); |
| 2143 -} |
| 2144 - |
| 2145 -bool ExtensionSet::ParseMessageSetItem(io::CodedInputStream* input, |
| 2146 - ExtensionFinder* extension_finder, |
| 2147 - MessageSetFieldSkipper* field_skipper) { |
| 2148 - // TODO(kenton): It would be nice to share code between this and |
| 2149 - // WireFormatLite::ParseAndMergeMessageSetItem(), but I think the |
| 2150 - // differences would be hard to factor out. |
| 2151 - |
| 2152 - // This method parses a group which should contain two fields: |
| 2153 - // required int32 type_id = 2; |
| 2154 - // required data message = 3; |
| 2155 - |
| 2156 - uint32 last_type_id = 0; |
| 2157 - |
| 2158 - // If we see message data before the type_id, we'll append it to this so |
| 2159 - // we can parse it later. |
| 2160 - string message_data; |
| 2161 - |
| 2162 - while (true) { |
| 2163 - const uint32 tag = input->ReadTag(); |
| 2164 - if (tag == 0) return false; |
| 2165 - |
| 2166 - switch (tag) { |
| 2167 - case WireFormatLite::kMessageSetTypeIdTag: { |
| 2168 - uint32 type_id; |
| 2169 - if (!input->ReadVarint32(&type_id)) return false; |
| 2170 - last_type_id = type_id; |
| 2171 - |
| 2172 - if (!message_data.empty()) { |
| 2173 - // We saw some message data before the type_id. Have to parse it |
| 2174 - // now. |
| 2175 - io::CodedInputStream sub_input( |
| 2176 - reinterpret_cast<const uint8*>(message_data.data()), |
| 2177 - message_data.size()); |
| 2178 - if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 2179 - last_type_id, &sub_input, |
| 2180 - extension_finder, field_skipper)) { |
| 2181 - return false; |
| 2182 - } |
| 2183 - message_data.clear(); |
| 2184 - } |
| 2185 - |
| 2186 - break; |
| 2187 - } |
| 2188 - |
| 2189 - case WireFormatLite::kMessageSetMessageTag: { |
| 2190 - if (last_type_id == 0) { |
| 2191 - // We haven't seen a type_id yet. Append this data to message_data. |
| 2192 - string temp; |
| 2193 - uint32 length; |
| 2194 - if (!input->ReadVarint32(&length)) return false; |
| 2195 - if (!input->ReadString(&temp, length)) return false; |
| 2196 - io::StringOutputStream output_stream(&message_data); |
| 2197 - io::CodedOutputStream coded_output(&output_stream); |
| 2198 - coded_output.WriteVarint32(length); |
| 2199 - coded_output.WriteString(temp); |
| 2200 - } else { |
| 2201 - // Already saw type_id, so we can parse this directly. |
| 2202 - if (!ParseFieldMaybeLazily(WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 2203 - last_type_id, input, |
| 2204 - extension_finder, field_skipper)) { |
| 2205 - return false; |
| 2206 - } |
| 2207 - } |
| 2208 - |
| 2209 - break; |
| 2210 - } |
| 2211 - |
| 2212 - case WireFormatLite::kMessageSetItemEndTag: { |
| 2213 - return true; |
| 2214 - } |
| 2215 - |
| 2216 - default: { |
| 2217 - if (!field_skipper->SkipField(input, tag)) return false; |
| 2218 - } |
| 2219 - } |
| 2220 - } |
| 2221 -} |
| 2222 - |
| 2223 void ExtensionSet::Extension::SerializeMessageSetItemWithCachedSizes( |
| 2224 int number, |
| 2225 io::CodedOutputStream* output) const { |
| 2226 diff --git a/third_party/protobuf/src/google/protobuf/generated_message_reflecti
on.cc b/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc |
| 2227 index 412c48a..0b01e73 100644 |
| 2228 --- a/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc |
| 2229 +++ b/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc |
| 2230 @@ -57,18 +57,6 @@ bool IsMapFieldInApi(const FieldDescriptor* field) { |
| 2231 } |
| 2232 } // anonymous namespace |
| 2233 |
| 2234 -int StringSpaceUsedExcludingSelf(const string& str) { |
| 2235 - const void* start = &str; |
| 2236 - const void* end = &str + 1; |
| 2237 - |
| 2238 - if (start <= str.data() && str.data() < end) { |
| 2239 - // The string's data is stored inside the string object itself. |
| 2240 - return 0; |
| 2241 - } else { |
| 2242 - return str.capacity(); |
| 2243 - } |
| 2244 -} |
| 2245 - |
| 2246 bool ParseNamedEnum(const EnumDescriptor* descriptor, |
| 2247 const string& name, |
| 2248 int* value) { |
| 2249 diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.cc
b/third_party/protobuf/src/google/protobuf/generated_message_util.cc |
| 2250 index 53cae8b..e8fb398 100644 |
| 2251 --- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc |
| 2252 +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.cc |
| 2253 @@ -60,6 +60,17 @@ void InitEmptyString() { |
| 2254 OnShutdown(&DeleteEmptyString); |
| 2255 } |
| 2256 |
| 2257 +int StringSpaceUsedExcludingSelf(const string& str) { |
| 2258 + const void* start = &str; |
| 2259 + const void* end = &str + 1; |
| 2260 + |
| 2261 + if (start <= str.data() && str.data() < end) { |
| 2262 + // The string's data is stored inside the string object itself. |
| 2263 + return 0; |
| 2264 + } else { |
| 2265 + return str.capacity(); |
| 2266 + } |
| 2267 +} |
| 2268 |
| 2269 } // namespace internal |
| 2270 } // namespace protobuf |
| 2271 diff --git a/third_party/protobuf/src/google/protobuf/unknown_field_set.cc b/thi
rd_party/protobuf/src/google/protobuf/unknown_field_set.cc |
| 2272 index 93f0f20..7e04a0e 100644 |
| 2273 --- a/third_party/protobuf/src/google/protobuf/unknown_field_set.cc |
| 2274 +++ b/third_party/protobuf/src/google/protobuf/unknown_field_set.cc |
| 2275 @@ -35,10 +35,12 @@ |
| 2276 #include <google/protobuf/unknown_field_set.h> |
| 2277 |
| 2278 #include <google/protobuf/stubs/common.h> |
| 2279 +#include <google/protobuf/stubs/once.h> |
| 2280 #include <google/protobuf/io/coded_stream.h> |
| 2281 #include <google/protobuf/io/zero_copy_stream.h> |
| 2282 -#include <google/protobuf/io/zero_copy_stream_impl.h> |
| 2283 -#include <google/protobuf/wire_format.h> |
| 2284 +#include <google/protobuf/io/zero_copy_stream_impl_lite.h> |
| 2285 +#include <google/protobuf/generated_message_util.h> |
| 2286 +#include <google/protobuf/wire_format_lite.h> |
| 2287 #include <google/protobuf/stubs/stl_util.h> |
| 2288 |
| 2289 namespace google { |
| 2290 @@ -254,7 +256,7 @@ void UnknownFieldSet::DeleteByNumber(int number) { |
| 2291 |
| 2292 bool UnknownFieldSet::MergeFromCodedStream(io::CodedInputStream* input) { |
| 2293 UnknownFieldSet other; |
| 2294 - if (internal::WireFormat::SkipMessage(input, &other) && |
| 2295 + if (internal::WireFormatLite::SkipMessage(input, &other) && |
| 2296 input->ConsumedEntireMessage()) { |
| 2297 MergeFromAndDestroy(&other); |
| 2298 return true; |
| 2299 diff --git a/third_party/protobuf/src/google/protobuf/util/internal/protostream_
objectsource.cc b/third_party/protobuf/src/google/protobuf/util/internal/protost
ream_objectsource.cc |
| 2300 index 53a0e47..8e0897d 100644 |
| 2301 --- a/third_party/protobuf/src/google/protobuf/util/internal/protostream_objects
ource.cc |
| 2302 +++ b/third_party/protobuf/src/google/protobuf/util/internal/protostream_objects
ource.cc |
| 2303 @@ -162,7 +162,7 @@ Status ProtoStreamObjectSource::WriteMessage(const google::p
rotobuf::Type& type, |
| 2304 if (field == NULL) { |
| 2305 // If we didn't find a field, skip this unknown tag. |
| 2306 // TODO(wpoon): Check return boolean value. |
| 2307 - WireFormat::SkipField(stream_, tag, NULL); |
| 2308 + WireFormatLite::SkipField(stream_, tag); |
| 2309 tag = stream_->ReadTag(); |
| 2310 continue; |
| 2311 } |
| 2312 @@ -239,7 +239,7 @@ Status ProtoStreamObjectSource::RenderMapEntry( |
| 2313 for (uint32 tag = stream_->ReadTag(); tag != 0; tag = stream_->ReadTag()) { |
| 2314 const google::protobuf::Field* field = FindAndVerifyField(*type, tag); |
| 2315 if (field == NULL) { |
| 2316 - WireFormat::SkipField(stream_, tag, NULL); |
| 2317 + WireFormatLite::SkipField(stream_, tag); |
| 2318 continue; |
| 2319 } |
| 2320 // Map field numbers are key = 1 and value = 2 |
| 2321 @@ -506,7 +506,7 @@ Status ProtoStreamObjectSource::RenderStructValue( |
| 2322 tag = os->stream_->ReadTag()) { |
| 2323 field = os->FindAndVerifyField(type, tag); |
| 2324 if (field == NULL) { |
| 2325 - WireFormat::SkipField(os->stream_, tag, NULL); |
| 2326 + WireFormatLite::SkipField(os->stream_, tag); |
| 2327 continue; |
| 2328 } |
| 2329 RETURN_IF_ERROR(os->RenderField(field, field_name, ow)); |
| 2330 @@ -530,7 +530,7 @@ Status ProtoStreamObjectSource::RenderStructListValue( |
| 2331 while (tag != 0) { |
| 2332 const google::protobuf::Field* field = os->FindAndVerifyField(type, tag); |
| 2333 if (field == NULL) { |
| 2334 - WireFormat::SkipField(os->stream_, tag, NULL); |
| 2335 + WireFormatLite::SkipField(os->stream_, tag); |
| 2336 tag = os->stream_->ReadTag(); |
| 2337 continue; |
| 2338 } |
| 2339 @@ -552,7 +552,7 @@ Status ProtoStreamObjectSource::RenderAny(const ProtoStreamO
bjectSource* os, |
| 2340 for (tag = os->stream_->ReadTag(); tag != 0; tag = os->stream_->ReadTag()) { |
| 2341 const google::protobuf::Field* field = os->FindAndVerifyField(type, tag); |
| 2342 if (field == NULL) { |
| 2343 - WireFormat::SkipField(os->stream_, tag, NULL); |
| 2344 + WireFormatLite::SkipField(os->stream_, tag); |
| 2345 continue; |
| 2346 } |
| 2347 // 'type_url' has field number of 1 and 'value' has field number 2 |
| 2348 @@ -982,7 +982,7 @@ std::pair<int64, int32> ProtoStreamObjectSource::ReadSeconds
AndNanos( |
| 2349 for (tag = stream_->ReadTag(); tag != 0; tag = stream_->ReadTag()) { |
| 2350 const google::protobuf::Field* field = FindAndVerifyField(type, tag); |
| 2351 if (field == NULL) { |
| 2352 - WireFormat::SkipField(stream_, tag, NULL); |
| 2353 + WireFormatLite::SkipField(stream_, tag); |
| 2354 continue; |
| 2355 } |
| 2356 // 'seconds' has field number of 1 and 'nanos' has field number 2 |
| 2357 diff --git a/third_party/protobuf/src/google/protobuf/wire_format.cc b/third_par
ty/protobuf/src/google/protobuf/wire_format.cc |
| 2358 index c5db963..7021f8e 100644 |
| 2359 --- a/third_party/protobuf/src/google/protobuf/wire_format.cc |
| 2360 +++ b/third_party/protobuf/src/google/protobuf/wire_format.cc |
| 2361 @@ -54,329 +54,6 @@ namespace google { |
| 2362 namespace protobuf { |
| 2363 namespace internal { |
| 2364 |
| 2365 -// =================================================================== |
| 2366 - |
| 2367 -bool UnknownFieldSetFieldSkipper::SkipField( |
| 2368 - io::CodedInputStream* input, uint32 tag) { |
| 2369 - return WireFormat::SkipField(input, tag, unknown_fields_); |
| 2370 -} |
| 2371 - |
| 2372 -bool UnknownFieldSetFieldSkipper::SkipMessage(io::CodedInputStream* input) { |
| 2373 - return WireFormat::SkipMessage(input, unknown_fields_); |
| 2374 -} |
| 2375 - |
| 2376 -void UnknownFieldSetFieldSkipper::SkipUnknownEnum( |
| 2377 - int field_number, int value) { |
| 2378 - unknown_fields_->AddVarint(field_number, value); |
| 2379 -} |
| 2380 - |
| 2381 -bool WireFormat::SkipField(io::CodedInputStream* input, uint32 tag, |
| 2382 - UnknownFieldSet* unknown_fields) { |
| 2383 - int number = WireFormatLite::GetTagFieldNumber(tag); |
| 2384 - |
| 2385 - switch (WireFormatLite::GetTagWireType(tag)) { |
| 2386 - case WireFormatLite::WIRETYPE_VARINT: { |
| 2387 - uint64 value; |
| 2388 - if (!input->ReadVarint64(&value)) return false; |
| 2389 - if (unknown_fields != NULL) unknown_fields->AddVarint(number, value); |
| 2390 - return true; |
| 2391 - } |
| 2392 - case WireFormatLite::WIRETYPE_FIXED64: { |
| 2393 - uint64 value; |
| 2394 - if (!input->ReadLittleEndian64(&value)) return false; |
| 2395 - if (unknown_fields != NULL) unknown_fields->AddFixed64(number, value); |
| 2396 - return true; |
| 2397 - } |
| 2398 - case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: { |
| 2399 - uint32 length; |
| 2400 - if (!input->ReadVarint32(&length)) return false; |
| 2401 - if (unknown_fields == NULL) { |
| 2402 - if (!input->Skip(length)) return false; |
| 2403 - } else { |
| 2404 - if (!input->ReadString(unknown_fields->AddLengthDelimited(number), |
| 2405 - length)) { |
| 2406 - return false; |
| 2407 - } |
| 2408 - } |
| 2409 - return true; |
| 2410 - } |
| 2411 - case WireFormatLite::WIRETYPE_START_GROUP: { |
| 2412 - if (!input->IncrementRecursionDepth()) return false; |
| 2413 - if (!SkipMessage(input, (unknown_fields == NULL) ? |
| 2414 - NULL : unknown_fields->AddGroup(number))) { |
| 2415 - return false; |
| 2416 - } |
| 2417 - input->DecrementRecursionDepth(); |
| 2418 - // Check that the ending tag matched the starting tag. |
| 2419 - if (!input->LastTagWas(WireFormatLite::MakeTag( |
| 2420 - WireFormatLite::GetTagFieldNumber(tag), |
| 2421 - WireFormatLite::WIRETYPE_END_GROUP))) { |
| 2422 - return false; |
| 2423 - } |
| 2424 - return true; |
| 2425 - } |
| 2426 - case WireFormatLite::WIRETYPE_END_GROUP: { |
| 2427 - return false; |
| 2428 - } |
| 2429 - case WireFormatLite::WIRETYPE_FIXED32: { |
| 2430 - uint32 value; |
| 2431 - if (!input->ReadLittleEndian32(&value)) return false; |
| 2432 - if (unknown_fields != NULL) unknown_fields->AddFixed32(number, value); |
| 2433 - return true; |
| 2434 - } |
| 2435 - default: { |
| 2436 - return false; |
| 2437 - } |
| 2438 - } |
| 2439 -} |
| 2440 - |
| 2441 -bool WireFormat::SkipMessage(io::CodedInputStream* input, |
| 2442 - UnknownFieldSet* unknown_fields) { |
| 2443 - while (true) { |
| 2444 - uint32 tag = input->ReadTag(); |
| 2445 - if (tag == 0) { |
| 2446 - // End of input. This is a valid place to end, so return true. |
| 2447 - return true; |
| 2448 - } |
| 2449 - |
| 2450 - WireFormatLite::WireType wire_type = WireFormatLite::GetTagWireType(tag); |
| 2451 - |
| 2452 - if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) { |
| 2453 - // Must be the end of the message. |
| 2454 - return true; |
| 2455 - } |
| 2456 - |
| 2457 - if (!SkipField(input, tag, unknown_fields)) return false; |
| 2458 - } |
| 2459 -} |
| 2460 - |
| 2461 -bool WireFormat::ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input, |
| 2462 - uint32 field_number, |
| 2463 - bool (*is_valid)(int), |
| 2464 - UnknownFieldSet* unknown_fields
, |
| 2465 - RepeatedField<int>* values) { |
| 2466 - uint32 length; |
| 2467 - if (!input->ReadVarint32(&length)) return false; |
| 2468 - io::CodedInputStream::Limit limit = input->PushLimit(length); |
| 2469 - while (input->BytesUntilLimit() > 0) { |
| 2470 - int value; |
| 2471 - if (!google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 2472 - int, WireFormatLite::TYPE_ENUM>(input, &value)) { |
| 2473 - return false; |
| 2474 - } |
| 2475 - if (is_valid == NULL || is_valid(value)) { |
| 2476 - values->Add(value); |
| 2477 - } else { |
| 2478 - unknown_fields->AddVarint(field_number, value); |
| 2479 - } |
| 2480 - } |
| 2481 - input->PopLimit(limit); |
| 2482 - return true; |
| 2483 -} |
| 2484 - |
| 2485 - |
| 2486 -void WireFormat::SerializeUnknownFields(const UnknownFieldSet& unknown_fields, |
| 2487 - io::CodedOutputStream* output) { |
| 2488 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2489 - const UnknownField& field = unknown_fields.field(i); |
| 2490 - switch (field.type()) { |
| 2491 - case UnknownField::TYPE_VARINT: |
| 2492 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2493 - WireFormatLite::WIRETYPE_VARINT)); |
| 2494 - output->WriteVarint64(field.varint()); |
| 2495 - break; |
| 2496 - case UnknownField::TYPE_FIXED32: |
| 2497 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2498 - WireFormatLite::WIRETYPE_FIXED32)); |
| 2499 - output->WriteLittleEndian32(field.fixed32()); |
| 2500 - break; |
| 2501 - case UnknownField::TYPE_FIXED64: |
| 2502 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2503 - WireFormatLite::WIRETYPE_FIXED64)); |
| 2504 - output->WriteLittleEndian64(field.fixed64()); |
| 2505 - break; |
| 2506 - case UnknownField::TYPE_LENGTH_DELIMITED: |
| 2507 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2508 - WireFormatLite::WIRETYPE_LENGTH_DELIMITED)); |
| 2509 - output->WriteVarint32(field.length_delimited().size()); |
| 2510 - output->WriteRawMaybeAliased(field.length_delimited().data(), |
| 2511 - field.length_delimited().size()); |
| 2512 - break; |
| 2513 - case UnknownField::TYPE_GROUP: |
| 2514 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2515 - WireFormatLite::WIRETYPE_START_GROUP)); |
| 2516 - SerializeUnknownFields(field.group(), output); |
| 2517 - output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2518 - WireFormatLite::WIRETYPE_END_GROUP)); |
| 2519 - break; |
| 2520 - } |
| 2521 - } |
| 2522 -} |
| 2523 - |
| 2524 -uint8* WireFormat::SerializeUnknownFieldsToArray( |
| 2525 - const UnknownFieldSet& unknown_fields, |
| 2526 - uint8* target) { |
| 2527 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2528 - const UnknownField& field = unknown_fields.field(i); |
| 2529 - |
| 2530 - switch (field.type()) { |
| 2531 - case UnknownField::TYPE_VARINT: |
| 2532 - target = WireFormatLite::WriteInt64ToArray( |
| 2533 - field.number(), field.varint(), target); |
| 2534 - break; |
| 2535 - case UnknownField::TYPE_FIXED32: |
| 2536 - target = WireFormatLite::WriteFixed32ToArray( |
| 2537 - field.number(), field.fixed32(), target); |
| 2538 - break; |
| 2539 - case UnknownField::TYPE_FIXED64: |
| 2540 - target = WireFormatLite::WriteFixed64ToArray( |
| 2541 - field.number(), field.fixed64(), target); |
| 2542 - break; |
| 2543 - case UnknownField::TYPE_LENGTH_DELIMITED: |
| 2544 - target = WireFormatLite::WriteBytesToArray( |
| 2545 - field.number(), field.length_delimited(), target); |
| 2546 - break; |
| 2547 - case UnknownField::TYPE_GROUP: |
| 2548 - target = WireFormatLite::WriteTagToArray( |
| 2549 - field.number(), WireFormatLite::WIRETYPE_START_GROUP, target); |
| 2550 - target = SerializeUnknownFieldsToArray(field.group(), target); |
| 2551 - target = WireFormatLite::WriteTagToArray( |
| 2552 - field.number(), WireFormatLite::WIRETYPE_END_GROUP, target); |
| 2553 - break; |
| 2554 - } |
| 2555 - } |
| 2556 - return target; |
| 2557 -} |
| 2558 - |
| 2559 -void WireFormat::SerializeUnknownMessageSetItems( |
| 2560 - const UnknownFieldSet& unknown_fields, |
| 2561 - io::CodedOutputStream* output) { |
| 2562 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2563 - const UnknownField& field = unknown_fields.field(i); |
| 2564 - // The only unknown fields that are allowed to exist in a MessageSet are |
| 2565 - // messages, which are length-delimited. |
| 2566 - if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 2567 - // Start group. |
| 2568 - output->WriteVarint32(WireFormatLite::kMessageSetItemStartTag); |
| 2569 - |
| 2570 - // Write type ID. |
| 2571 - output->WriteVarint32(WireFormatLite::kMessageSetTypeIdTag); |
| 2572 - output->WriteVarint32(field.number()); |
| 2573 - |
| 2574 - // Write message. |
| 2575 - output->WriteVarint32(WireFormatLite::kMessageSetMessageTag); |
| 2576 - field.SerializeLengthDelimitedNoTag(output); |
| 2577 - |
| 2578 - // End group. |
| 2579 - output->WriteVarint32(WireFormatLite::kMessageSetItemEndTag); |
| 2580 - } |
| 2581 - } |
| 2582 -} |
| 2583 - |
| 2584 -uint8* WireFormat::SerializeUnknownMessageSetItemsToArray( |
| 2585 - const UnknownFieldSet& unknown_fields, |
| 2586 - uint8* target) { |
| 2587 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2588 - const UnknownField& field = unknown_fields.field(i); |
| 2589 - |
| 2590 - // The only unknown fields that are allowed to exist in a MessageSet are |
| 2591 - // messages, which are length-delimited. |
| 2592 - if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 2593 - // Start group. |
| 2594 - target = io::CodedOutputStream::WriteTagToArray( |
| 2595 - WireFormatLite::kMessageSetItemStartTag, target); |
| 2596 - |
| 2597 - // Write type ID. |
| 2598 - target = io::CodedOutputStream::WriteTagToArray( |
| 2599 - WireFormatLite::kMessageSetTypeIdTag, target); |
| 2600 - target = io::CodedOutputStream::WriteVarint32ToArray( |
| 2601 - field.number(), target); |
| 2602 - |
| 2603 - // Write message. |
| 2604 - target = io::CodedOutputStream::WriteTagToArray( |
| 2605 - WireFormatLite::kMessageSetMessageTag, target); |
| 2606 - target = field.SerializeLengthDelimitedNoTagToArray(target); |
| 2607 - |
| 2608 - // End group. |
| 2609 - target = io::CodedOutputStream::WriteTagToArray( |
| 2610 - WireFormatLite::kMessageSetItemEndTag, target); |
| 2611 - } |
| 2612 - } |
| 2613 - |
| 2614 - return target; |
| 2615 -} |
| 2616 - |
| 2617 -int WireFormat::ComputeUnknownFieldsSize( |
| 2618 - const UnknownFieldSet& unknown_fields) { |
| 2619 - int size = 0; |
| 2620 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2621 - const UnknownField& field = unknown_fields.field(i); |
| 2622 - |
| 2623 - switch (field.type()) { |
| 2624 - case UnknownField::TYPE_VARINT: |
| 2625 - size += io::CodedOutputStream::VarintSize32( |
| 2626 - WireFormatLite::MakeTag(field.number(), |
| 2627 - WireFormatLite::WIRETYPE_VARINT)); |
| 2628 - size += io::CodedOutputStream::VarintSize64(field.varint()); |
| 2629 - break; |
| 2630 - case UnknownField::TYPE_FIXED32: |
| 2631 - size += io::CodedOutputStream::VarintSize32( |
| 2632 - WireFormatLite::MakeTag(field.number(), |
| 2633 - WireFormatLite::WIRETYPE_FIXED32)); |
| 2634 - size += sizeof(int32); |
| 2635 - break; |
| 2636 - case UnknownField::TYPE_FIXED64: |
| 2637 - size += io::CodedOutputStream::VarintSize32( |
| 2638 - WireFormatLite::MakeTag(field.number(), |
| 2639 - WireFormatLite::WIRETYPE_FIXED64)); |
| 2640 - size += sizeof(int64); |
| 2641 - break; |
| 2642 - case UnknownField::TYPE_LENGTH_DELIMITED: |
| 2643 - size += io::CodedOutputStream::VarintSize32( |
| 2644 - WireFormatLite::MakeTag(field.number(), |
| 2645 - WireFormatLite::WIRETYPE_LENGTH_DELIMITED)); |
| 2646 - size += io::CodedOutputStream::VarintSize32( |
| 2647 - field.length_delimited().size()); |
| 2648 - size += field.length_delimited().size(); |
| 2649 - break; |
| 2650 - case UnknownField::TYPE_GROUP: |
| 2651 - size += io::CodedOutputStream::VarintSize32( |
| 2652 - WireFormatLite::MakeTag(field.number(), |
| 2653 - WireFormatLite::WIRETYPE_START_GROUP)); |
| 2654 - size += ComputeUnknownFieldsSize(field.group()); |
| 2655 - size += io::CodedOutputStream::VarintSize32( |
| 2656 - WireFormatLite::MakeTag(field.number(), |
| 2657 - WireFormatLite::WIRETYPE_END_GROUP)); |
| 2658 - break; |
| 2659 - } |
| 2660 - } |
| 2661 - |
| 2662 - return size; |
| 2663 -} |
| 2664 - |
| 2665 -int WireFormat::ComputeUnknownMessageSetItemsSize( |
| 2666 - const UnknownFieldSet& unknown_fields) { |
| 2667 - int size = 0; |
| 2668 - for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2669 - const UnknownField& field = unknown_fields.field(i); |
| 2670 - |
| 2671 - // The only unknown fields that are allowed to exist in a MessageSet are |
| 2672 - // messages, which are length-delimited. |
| 2673 - if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 2674 - size += WireFormatLite::kMessageSetItemTagsSize; |
| 2675 - size += io::CodedOutputStream::VarintSize32(field.number()); |
| 2676 - |
| 2677 - int field_size = field.GetLengthDelimitedSize(); |
| 2678 - size += io::CodedOutputStream::VarintSize32(field_size); |
| 2679 - size += field_size; |
| 2680 - } |
| 2681 - } |
| 2682 - |
| 2683 - return size; |
| 2684 -} |
| 2685 - |
| 2686 -// =================================================================== |
| 2687 - |
| 2688 bool WireFormat::ParseAndMergePartial(io::CodedInputStream* input, |
| 2689 Message* message) { |
| 2690 const Descriptor* descriptor = message->GetDescriptor(); |
| 2691 @@ -485,8 +162,8 @@ bool WireFormat::ParseAndMergeField( |
| 2692 } |
| 2693 |
| 2694 if (value_format == UNKNOWN) { |
| 2695 - return SkipField(input, tag, |
| 2696 - message_reflection->MutableUnknownFields(message)); |
| 2697 + return WireFormatLite::SkipField( |
| 2698 + input, tag, message_reflection->MutableUnknownFields(message)); |
| 2699 } else if (value_format == PACKED_FORMAT) { |
| 2700 uint32 length; |
| 2701 if (!input->ReadVarint32(&length)) return false; |
| 2702 @@ -763,7 +440,7 @@ bool WireFormat::ParseAndMergeMessageSetItem( |
| 2703 } |
| 2704 |
| 2705 default: { |
| 2706 - if (!SkipField(input, tag, NULL)) return false; |
| 2707 + if (!WireFormatLite::SkipField(input, tag)) return false; |
| 2708 } |
| 2709 } |
| 2710 } |
| 2711 @@ -785,10 +462,10 @@ void WireFormat::SerializeWithCachedSizes( |
| 2712 } |
| 2713 |
| 2714 if (descriptor->options().message_set_wire_format()) { |
| 2715 - SerializeUnknownMessageSetItems( |
| 2716 + WireFormatLite::SerializeUnknownMessageSetItems( |
| 2717 message_reflection->GetUnknownFields(message), output); |
| 2718 } else { |
| 2719 - SerializeUnknownFields( |
| 2720 + WireFormatLite::SerializeUnknownFields( |
| 2721 message_reflection->GetUnknownFields(message), output); |
| 2722 } |
| 2723 |
| 2724 @@ -956,10 +633,10 @@ int WireFormat::ByteSize(const Message& message) { |
| 2725 } |
| 2726 |
| 2727 if (descriptor->options().message_set_wire_format()) { |
| 2728 - our_size += ComputeUnknownMessageSetItemsSize( |
| 2729 + our_size += WireFormatLite::ComputeUnknownMessageSetItemsSize( |
| 2730 message_reflection->GetUnknownFields(message)); |
| 2731 } else { |
| 2732 - our_size += ComputeUnknownFieldsSize( |
| 2733 + our_size += WireFormatLite::ComputeUnknownFieldsSize( |
| 2734 message_reflection->GetUnknownFields(message)); |
| 2735 } |
| 2736 |
| 2737 diff --git a/third_party/protobuf/src/google/protobuf/wire_format.h b/third_part
y/protobuf/src/google/protobuf/wire_format.h |
| 2738 index 84270fe..860db13 100644 |
| 2739 --- a/third_party/protobuf/src/google/protobuf/wire_format.h |
| 2740 +++ b/third_party/protobuf/src/google/protobuf/wire_format.h |
| 2741 @@ -57,7 +57,6 @@ namespace protobuf { |
| 2742 class CodedInputStream; // coded_stream.h |
| 2743 class CodedOutputStream; // coded_stream.h |
| 2744 } |
| 2745 - class UnknownFieldSet; // unknown_field_set.h |
| 2746 } |
| 2747 |
| 2748 namespace protobuf { |
| 2749 @@ -124,62 +123,6 @@ class LIBPROTOBUF_EXPORT WireFormat { |
| 2750 // WireFormat::SerializeWithCachedSizes() on the same object. |
| 2751 static int ByteSize(const Message& message); |
| 2752 |
| 2753 - // ----------------------------------------------------------------- |
| 2754 - // Helpers for dealing with unknown fields |
| 2755 - |
| 2756 - // Skips a field value of the given WireType. The input should start |
| 2757 - // positioned immediately after the tag. If unknown_fields is non-NULL, |
| 2758 - // the contents of the field will be added to it. |
| 2759 - static bool SkipField(io::CodedInputStream* input, uint32 tag, |
| 2760 - UnknownFieldSet* unknown_fields); |
| 2761 - |
| 2762 - // Reads and ignores a message from the input. If unknown_fields is non-NULL
, |
| 2763 - // the contents will be added to it. |
| 2764 - static bool SkipMessage(io::CodedInputStream* input, |
| 2765 - UnknownFieldSet* unknown_fields); |
| 2766 - |
| 2767 - // Read a packed enum field. If the is_valid function is not NULL, values for |
| 2768 - // which is_valid(value) returns false are appended to unknown_fields_stream. |
| 2769 - static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input, |
| 2770 - uint32 field_number, |
| 2771 - bool (*is_valid)(int), |
| 2772 - UnknownFieldSet* unknown_fields, |
| 2773 - RepeatedField<int>* values); |
| 2774 - |
| 2775 - // Write the contents of an UnknownFieldSet to the output. |
| 2776 - static void SerializeUnknownFields(const UnknownFieldSet& unknown_fields, |
| 2777 - io::CodedOutputStream* output); |
| 2778 - // Same as above, except writing directly to the provided buffer. |
| 2779 - // Requires that the buffer have sufficient capacity for |
| 2780 - // ComputeUnknownFieldsSize(unknown_fields). |
| 2781 - // |
| 2782 - // Returns a pointer past the last written byte. |
| 2783 - static uint8* SerializeUnknownFieldsToArray( |
| 2784 - const UnknownFieldSet& unknown_fields, |
| 2785 - uint8* target); |
| 2786 - |
| 2787 - // Same thing except for messages that have the message_set_wire_format |
| 2788 - // option. |
| 2789 - static void SerializeUnknownMessageSetItems( |
| 2790 - const UnknownFieldSet& unknown_fields, |
| 2791 - io::CodedOutputStream* output); |
| 2792 - // Same as above, except writing directly to the provided buffer. |
| 2793 - // Requires that the buffer have sufficient capacity for |
| 2794 - // ComputeUnknownMessageSetItemsSize(unknown_fields). |
| 2795 - // |
| 2796 - // Returns a pointer past the last written byte. |
| 2797 - static uint8* SerializeUnknownMessageSetItemsToArray( |
| 2798 - const UnknownFieldSet& unknown_fields, |
| 2799 - uint8* target); |
| 2800 - |
| 2801 - // Compute the size of the UnknownFieldSet on the wire. |
| 2802 - static int ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields); |
| 2803 - |
| 2804 - // Same thing except for messages that have the message_set_wire_format |
| 2805 - // option. |
| 2806 - static int ComputeUnknownMessageSetItemsSize( |
| 2807 - const UnknownFieldSet& unknown_fields); |
| 2808 - |
| 2809 |
| 2810 // Helper functions for encoding and decoding tags. (Inlined below and in |
| 2811 // _inl.h) |
| 2812 @@ -270,22 +213,6 @@ class LIBPROTOBUF_EXPORT WireFormat { |
| 2813 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormat); |
| 2814 }; |
| 2815 |
| 2816 -// Subclass of FieldSkipper which saves skipped fields to an UnknownFieldSet. |
| 2817 -class LIBPROTOBUF_EXPORT UnknownFieldSetFieldSkipper : public FieldSkipper { |
| 2818 - public: |
| 2819 - UnknownFieldSetFieldSkipper(UnknownFieldSet* unknown_fields) |
| 2820 - : unknown_fields_(unknown_fields) {} |
| 2821 - virtual ~UnknownFieldSetFieldSkipper() {} |
| 2822 - |
| 2823 - // implements FieldSkipper ----------------------------------------- |
| 2824 - virtual bool SkipField(io::CodedInputStream* input, uint32 tag); |
| 2825 - virtual bool SkipMessage(io::CodedInputStream* input); |
| 2826 - virtual void SkipUnknownEnum(int field_number, int value); |
| 2827 - |
| 2828 - protected: |
| 2829 - UnknownFieldSet* unknown_fields_; |
| 2830 -}; |
| 2831 - |
| 2832 // inline methods ==================================================== |
| 2833 |
| 2834 inline WireFormatLite::WireType WireFormat::WireTypeForField( |
| 2835 diff --git a/third_party/protobuf/src/google/protobuf/wire_format_lite.cc b/thir
d_party/protobuf/src/google/protobuf/wire_format_lite.cc |
| 2836 index 2ce4920..58160c1f 100644 |
| 2837 --- a/third_party/protobuf/src/google/protobuf/wire_format_lite.cc |
| 2838 +++ b/third_party/protobuf/src/google/protobuf/wire_format_lite.cc |
| 2839 @@ -55,6 +55,24 @@ const int WireFormatLite::kMessageSetMessageTag; |
| 2840 |
| 2841 #endif |
| 2842 |
| 2843 +// =================================================================== |
| 2844 + |
| 2845 +bool FieldSkipper::SkipField( |
| 2846 + io::CodedInputStream* input, uint32 tag) { |
| 2847 + return WireFormatLite::SkipField(input, tag, unknown_fields_); |
| 2848 +} |
| 2849 + |
| 2850 +bool FieldSkipper::SkipMessage(io::CodedInputStream* input) { |
| 2851 + return WireFormatLite::SkipMessage(input, unknown_fields_); |
| 2852 +} |
| 2853 + |
| 2854 +void FieldSkipper::SkipUnknownEnum( |
| 2855 + int field_number, int value) { |
| 2856 + unknown_fields_->AddVarint(field_number, value); |
| 2857 +} |
| 2858 + |
| 2859 +// =================================================================== |
| 2860 + |
| 2861 // IBM xlC requires prefixing constants with WireFormatLite:: |
| 2862 const int WireFormatLite::kMessageSetItemTagsSize = |
| 2863 io::CodedOutputStream::StaticVarintSize32< |
| 2864 @@ -113,28 +131,46 @@ WireFormatLite::kWireTypeForFieldType[MAX_FIELD_TYPE + 1]
= { |
| 2865 WireFormatLite::WIRETYPE_VARINT, // TYPE_SINT64 |
| 2866 }; |
| 2867 |
| 2868 -bool WireFormatLite::SkipField( |
| 2869 - io::CodedInputStream* input, uint32 tag) { |
| 2870 +bool WireFormatLite::SkipField(io::CodedInputStream* input, uint32 tag) { |
| 2871 + return SkipField(input, tag, static_cast<UnknownFieldSet*>(NULL)); |
| 2872 +} |
| 2873 + |
| 2874 +bool WireFormatLite::SkipField(io::CodedInputStream* input, uint32 tag, |
| 2875 + UnknownFieldSet* unknown_fields) { |
| 2876 + int number = WireFormatLite::GetTagFieldNumber(tag); |
| 2877 + |
| 2878 switch (WireFormatLite::GetTagWireType(tag)) { |
| 2879 case WireFormatLite::WIRETYPE_VARINT: { |
| 2880 uint64 value; |
| 2881 if (!input->ReadVarint64(&value)) return false; |
| 2882 + if (unknown_fields != NULL) unknown_fields->AddVarint(number, value); |
| 2883 return true; |
| 2884 } |
| 2885 case WireFormatLite::WIRETYPE_FIXED64: { |
| 2886 uint64 value; |
| 2887 if (!input->ReadLittleEndian64(&value)) return false; |
| 2888 + if (unknown_fields != NULL) unknown_fields->AddFixed64(number, value); |
| 2889 return true; |
| 2890 } |
| 2891 case WireFormatLite::WIRETYPE_LENGTH_DELIMITED: { |
| 2892 uint32 length; |
| 2893 if (!input->ReadVarint32(&length)) return false; |
| 2894 - if (!input->Skip(length)) return false; |
| 2895 + if (unknown_fields == NULL) { |
| 2896 + if (!input->Skip(length)) return false; |
| 2897 + } else { |
| 2898 + if (!input->ReadString(unknown_fields->AddLengthDelimited(number), |
| 2899 + length)) { |
| 2900 + return false; |
| 2901 + } |
| 2902 + } |
| 2903 return true; |
| 2904 } |
| 2905 case WireFormatLite::WIRETYPE_START_GROUP: { |
| 2906 if (!input->IncrementRecursionDepth()) return false; |
| 2907 - if (!SkipMessage(input)) return false; |
| 2908 + if (!SkipMessage(input, (unknown_fields == NULL) ? |
| 2909 + NULL : unknown_fields->AddGroup(number))) { |
| 2910 + return false; |
| 2911 + } |
| 2912 input->DecrementRecursionDepth(); |
| 2913 // Check that the ending tag matched the starting tag. |
| 2914 if (!input->LastTagWas(WireFormatLite::MakeTag( |
| 2915 @@ -150,6 +186,7 @@ bool WireFormatLite::SkipField( |
| 2916 case WireFormatLite::WIRETYPE_FIXED32: { |
| 2917 uint32 value; |
| 2918 if (!input->ReadLittleEndian32(&value)) return false; |
| 2919 + if (unknown_fields != NULL) unknown_fields->AddFixed32(number, value); |
| 2920 return true; |
| 2921 } |
| 2922 default: { |
| 2923 @@ -215,7 +252,8 @@ bool WireFormatLite::SkipField( |
| 2924 } |
| 2925 } |
| 2926 |
| 2927 -bool WireFormatLite::SkipMessage(io::CodedInputStream* input) { |
| 2928 +bool WireFormatLite::SkipMessage(io::CodedInputStream* input, |
| 2929 + UnknownFieldSet* unknown_fields) { |
| 2930 while (true) { |
| 2931 uint32 tag = input->ReadTag(); |
| 2932 if (tag == 0) { |
| 2933 @@ -230,7 +268,7 @@ bool WireFormatLite::SkipMessage(io::CodedInputStream* input
) { |
| 2934 return true; |
| 2935 } |
| 2936 |
| 2937 - if (!SkipField(input, tag)) return false; |
| 2938 + if (!SkipField(input, tag, unknown_fields)) return false; |
| 2939 } |
| 2940 } |
| 2941 |
| 2942 @@ -255,18 +293,231 @@ bool WireFormatLite::SkipMessage(io::CodedInputStream* in
put, |
| 2943 } |
| 2944 } |
| 2945 |
| 2946 -bool FieldSkipper::SkipField( |
| 2947 - io::CodedInputStream* input, uint32 tag) { |
| 2948 - return WireFormatLite::SkipField(input, tag); |
| 2949 +bool WireFormatLite::ReadPackedEnumPreserveUnknowns( |
| 2950 + io::CodedInputStream* input, |
| 2951 + uint32 field_number, |
| 2952 + bool (*is_valid)(int), |
| 2953 + UnknownFieldSet* unknown_fields, |
| 2954 + RepeatedField<int>* values) { |
| 2955 + uint32 length; |
| 2956 + if (!input->ReadVarint32(&length)) return false; |
| 2957 + io::CodedInputStream::Limit limit = input->PushLimit(length); |
| 2958 + while (input->BytesUntilLimit() > 0) { |
| 2959 + int value; |
| 2960 + if (!google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 2961 + int, WireFormatLite::TYPE_ENUM>(input, &value)) { |
| 2962 + return false; |
| 2963 + } |
| 2964 + if (is_valid == NULL || is_valid(value)) { |
| 2965 + values->Add(value); |
| 2966 + } else { |
| 2967 + unknown_fields->AddVarint(field_number, value); |
| 2968 + } |
| 2969 + } |
| 2970 + input->PopLimit(limit); |
| 2971 + return true; |
| 2972 } |
| 2973 |
| 2974 -bool FieldSkipper::SkipMessage(io::CodedInputStream* input) { |
| 2975 - return WireFormatLite::SkipMessage(input); |
| 2976 + |
| 2977 +void WireFormatLite::SerializeUnknownFields( |
| 2978 + const UnknownFieldSet& unknown_fields, |
| 2979 + io::CodedOutputStream* output) { |
| 2980 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 2981 + const UnknownField& field = unknown_fields.field(i); |
| 2982 + switch (field.type()) { |
| 2983 + case UnknownField::TYPE_VARINT: |
| 2984 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2985 + WireFormatLite::WIRETYPE_VARINT)); |
| 2986 + output->WriteVarint64(field.varint()); |
| 2987 + break; |
| 2988 + case UnknownField::TYPE_FIXED32: |
| 2989 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2990 + WireFormatLite::WIRETYPE_FIXED32)); |
| 2991 + output->WriteLittleEndian32(field.fixed32()); |
| 2992 + break; |
| 2993 + case UnknownField::TYPE_FIXED64: |
| 2994 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 2995 + WireFormatLite::WIRETYPE_FIXED64)); |
| 2996 + output->WriteLittleEndian64(field.fixed64()); |
| 2997 + break; |
| 2998 + case UnknownField::TYPE_LENGTH_DELIMITED: |
| 2999 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 3000 + WireFormatLite::WIRETYPE_LENGTH_DELIMITED)); |
| 3001 + output->WriteVarint32(field.length_delimited().size()); |
| 3002 + output->WriteRawMaybeAliased(field.length_delimited().data(), |
| 3003 + field.length_delimited().size()); |
| 3004 + break; |
| 3005 + case UnknownField::TYPE_GROUP: |
| 3006 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 3007 + WireFormatLite::WIRETYPE_START_GROUP)); |
| 3008 + SerializeUnknownFields(field.group(), output); |
| 3009 + output->WriteVarint32(WireFormatLite::MakeTag(field.number(), |
| 3010 + WireFormatLite::WIRETYPE_END_GROUP)); |
| 3011 + break; |
| 3012 + } |
| 3013 + } |
| 3014 } |
| 3015 |
| 3016 -void FieldSkipper::SkipUnknownEnum( |
| 3017 - int /* field_number */, int /* value */) { |
| 3018 - // Nothing. |
| 3019 +uint8* WireFormatLite::SerializeUnknownFieldsToArray( |
| 3020 + const UnknownFieldSet& unknown_fields, |
| 3021 + uint8* target) { |
| 3022 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 3023 + const UnknownField& field = unknown_fields.field(i); |
| 3024 + |
| 3025 + switch (field.type()) { |
| 3026 + case UnknownField::TYPE_VARINT: |
| 3027 + target = WireFormatLite::WriteInt64ToArray( |
| 3028 + field.number(), field.varint(), target); |
| 3029 + break; |
| 3030 + case UnknownField::TYPE_FIXED32: |
| 3031 + target = WireFormatLite::WriteFixed32ToArray( |
| 3032 + field.number(), field.fixed32(), target); |
| 3033 + break; |
| 3034 + case UnknownField::TYPE_FIXED64: |
| 3035 + target = WireFormatLite::WriteFixed64ToArray( |
| 3036 + field.number(), field.fixed64(), target); |
| 3037 + break; |
| 3038 + case UnknownField::TYPE_LENGTH_DELIMITED: |
| 3039 + target = WireFormatLite::WriteBytesToArray( |
| 3040 + field.number(), field.length_delimited(), target); |
| 3041 + break; |
| 3042 + case UnknownField::TYPE_GROUP: |
| 3043 + target = WireFormatLite::WriteTagToArray( |
| 3044 + field.number(), WireFormatLite::WIRETYPE_START_GROUP, target); |
| 3045 + target = SerializeUnknownFieldsToArray(field.group(), target); |
| 3046 + target = WireFormatLite::WriteTagToArray( |
| 3047 + field.number(), WireFormatLite::WIRETYPE_END_GROUP, target); |
| 3048 + break; |
| 3049 + } |
| 3050 + } |
| 3051 + return target; |
| 3052 +} |
| 3053 + |
| 3054 +void WireFormatLite::SerializeUnknownMessageSetItems( |
| 3055 + const UnknownFieldSet& unknown_fields, |
| 3056 + io::CodedOutputStream* output) { |
| 3057 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 3058 + const UnknownField& field = unknown_fields.field(i); |
| 3059 + // The only unknown fields that are allowed to exist in a MessageSet are |
| 3060 + // messages, which are length-delimited. |
| 3061 + if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 3062 + // Start group. |
| 3063 + output->WriteVarint32(WireFormatLite::kMessageSetItemStartTag); |
| 3064 + |
| 3065 + // Write type ID. |
| 3066 + output->WriteVarint32(WireFormatLite::kMessageSetTypeIdTag); |
| 3067 + output->WriteVarint32(field.number()); |
| 3068 + |
| 3069 + // Write message. |
| 3070 + output->WriteVarint32(WireFormatLite::kMessageSetMessageTag); |
| 3071 + field.SerializeLengthDelimitedNoTag(output); |
| 3072 + |
| 3073 + // End group. |
| 3074 + output->WriteVarint32(WireFormatLite::kMessageSetItemEndTag); |
| 3075 + } |
| 3076 + } |
| 3077 +} |
| 3078 + |
| 3079 +uint8* WireFormatLite::SerializeUnknownMessageSetItemsToArray( |
| 3080 + const UnknownFieldSet& unknown_fields, |
| 3081 + uint8* target) { |
| 3082 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 3083 + const UnknownField& field = unknown_fields.field(i); |
| 3084 + |
| 3085 + // The only unknown fields that are allowed to exist in a MessageSet are |
| 3086 + // messages, which are length-delimited. |
| 3087 + if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 3088 + // Start group. |
| 3089 + target = io::CodedOutputStream::WriteTagToArray( |
| 3090 + WireFormatLite::kMessageSetItemStartTag, target); |
| 3091 + |
| 3092 + // Write type ID. |
| 3093 + target = io::CodedOutputStream::WriteTagToArray( |
| 3094 + WireFormatLite::kMessageSetTypeIdTag, target); |
| 3095 + target = io::CodedOutputStream::WriteVarint32ToArray( |
| 3096 + field.number(), target); |
| 3097 + |
| 3098 + // Write message. |
| 3099 + target = io::CodedOutputStream::WriteTagToArray( |
| 3100 + WireFormatLite::kMessageSetMessageTag, target); |
| 3101 + target = field.SerializeLengthDelimitedNoTagToArray(target); |
| 3102 + |
| 3103 + // End group. |
| 3104 + target = io::CodedOutputStream::WriteTagToArray( |
| 3105 + WireFormatLite::kMessageSetItemEndTag, target); |
| 3106 + } |
| 3107 + } |
| 3108 + |
| 3109 + return target; |
| 3110 +} |
| 3111 + |
| 3112 +int WireFormatLite::ComputeUnknownFieldsSize( |
| 3113 + const UnknownFieldSet& unknown_fields) { |
| 3114 + int size = 0; |
| 3115 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 3116 + const UnknownField& field = unknown_fields.field(i); |
| 3117 + |
| 3118 + switch (field.type()) { |
| 3119 + case UnknownField::TYPE_VARINT: |
| 3120 + size += io::CodedOutputStream::VarintSize32( |
| 3121 + WireFormatLite::MakeTag(field.number(), |
| 3122 + WireFormatLite::WIRETYPE_VARINT)); |
| 3123 + size += io::CodedOutputStream::VarintSize64(field.varint()); |
| 3124 + break; |
| 3125 + case UnknownField::TYPE_FIXED32: |
| 3126 + size += io::CodedOutputStream::VarintSize32( |
| 3127 + WireFormatLite::MakeTag(field.number(), |
| 3128 + WireFormatLite::WIRETYPE_FIXED32)); |
| 3129 + size += sizeof(int32); |
| 3130 + break; |
| 3131 + case UnknownField::TYPE_FIXED64: |
| 3132 + size += io::CodedOutputStream::VarintSize32( |
| 3133 + WireFormatLite::MakeTag(field.number(), |
| 3134 + WireFormatLite::WIRETYPE_FIXED64)); |
| 3135 + size += sizeof(int64); |
| 3136 + break; |
| 3137 + case UnknownField::TYPE_LENGTH_DELIMITED: |
| 3138 + size += io::CodedOutputStream::VarintSize32( |
| 3139 + WireFormatLite::MakeTag(field.number(), |
| 3140 + WireFormatLite::WIRETYPE_LENGTH_DELIMITED)); |
| 3141 + size += io::CodedOutputStream::VarintSize32( |
| 3142 + field.length_delimited().size()); |
| 3143 + size += field.length_delimited().size(); |
| 3144 + break; |
| 3145 + case UnknownField::TYPE_GROUP: |
| 3146 + size += io::CodedOutputStream::VarintSize32( |
| 3147 + WireFormatLite::MakeTag(field.number(), |
| 3148 + WireFormatLite::WIRETYPE_START_GROUP)); |
| 3149 + size += ComputeUnknownFieldsSize(field.group()); |
| 3150 + size += io::CodedOutputStream::VarintSize32( |
| 3151 + WireFormatLite::MakeTag(field.number(), |
| 3152 + WireFormatLite::WIRETYPE_END_GROUP)); |
| 3153 + break; |
| 3154 + } |
| 3155 + } |
| 3156 + |
| 3157 + return size; |
| 3158 +} |
| 3159 + |
| 3160 +int WireFormatLite::ComputeUnknownMessageSetItemsSize( |
| 3161 + const UnknownFieldSet& unknown_fields) { |
| 3162 + int size = 0; |
| 3163 + for (int i = 0; i < unknown_fields.field_count(); i++) { |
| 3164 + const UnknownField& field = unknown_fields.field(i); |
| 3165 + |
| 3166 + // The only unknown fields that are allowed to exist in a MessageSet are |
| 3167 + // messages, which are length-delimited. |
| 3168 + if (field.type() == UnknownField::TYPE_LENGTH_DELIMITED) { |
| 3169 + size += WireFormatLite::kMessageSetItemTagsSize; |
| 3170 + size += io::CodedOutputStream::VarintSize32(field.number()); |
| 3171 + |
| 3172 + int field_size = field.GetLengthDelimitedSize(); |
| 3173 + size += io::CodedOutputStream::VarintSize32(field_size); |
| 3174 + size += field_size; |
| 3175 + } |
| 3176 + } |
| 3177 + |
| 3178 + return size; |
| 3179 } |
| 3180 |
| 3181 bool CodedOutputStreamFieldSkipper::SkipField( |
| 3182 diff --git a/third_party/protobuf/src/google/protobuf/wire_format_lite.h b/third
_party/protobuf/src/google/protobuf/wire_format_lite.h |
| 3183 index ac83abd..9f922fd 100644 |
| 3184 --- a/third_party/protobuf/src/google/protobuf/wire_format_lite.h |
| 3185 +++ b/third_party/protobuf/src/google/protobuf/wire_format_lite.h |
| 3186 @@ -44,11 +44,13 @@ |
| 3187 #include <google/protobuf/stubs/common.h> |
| 3188 #include <google/protobuf/message_lite.h> |
| 3189 #include <google/protobuf/io/coded_stream.h> // for CodedOutputStream::Varint3
2Size |
| 3190 +#include <google/protobuf/unknown_field_set.h> |
| 3191 |
| 3192 namespace google { |
| 3193 |
| 3194 namespace protobuf { |
| 3195 template <typename T> class RepeatedField; // repeated_field.h |
| 3196 + class UnknownFieldSet; // unknown_field_set.h |
| 3197 } |
| 3198 |
| 3199 namespace protobuf { |
| 3200 @@ -157,21 +159,33 @@ class LIBPROTOBUF_EXPORT WireFormatLite { |
| 3201 // and end tags. |
| 3202 static inline int TagSize(int field_number, WireFormatLite::FieldType type); |
| 3203 |
| 3204 + // ----------------------------------------------------------------- |
| 3205 + // Helpers for dealing with unknown fields |
| 3206 + |
| 3207 // Skips a field value with the given tag. The input should start |
| 3208 // positioned immediately after the tag. Skipped values are simply discarded
, |
| 3209 - // not recorded anywhere. See WireFormat::SkipField() for a version that |
| 3210 - // records to an UnknownFieldSet. |
| 3211 + // not recorded anywhere. |
| 3212 static bool SkipField(io::CodedInputStream* input, uint32 tag); |
| 3213 |
| 3214 // Skips a field value with the given tag. The input should start |
| 3215 + // positioned immediately after the tag. If unknown_fields is non-NULL, |
| 3216 + // the contents of the field will be added to it. |
| 3217 + static bool SkipField(io::CodedInputStream* input, uint32 tag, |
| 3218 + UnknownFieldSet* unknown_fields); |
| 3219 + |
| 3220 + // Skips a field value with the given tag. The input should start |
| 3221 // positioned immediately after the tag. Skipped values are recorded to a |
| 3222 // CodedOutputStream. |
| 3223 static bool SkipField(io::CodedInputStream* input, uint32 tag, |
| 3224 io::CodedOutputStream* output); |
| 3225 |
| 3226 - // Reads and ignores a message from the input. Skipped values are simply |
| 3227 - // discarded, not recorded anywhere. See WireFormat::SkipMessage() for a |
| 3228 - // version that records to an UnknownFieldSet. |
| 3229 + // Reads and ignores a message from the input. If unknown_fields is non-NULL
, |
| 3230 + // the contents will be added to it. |
| 3231 + static bool SkipMessage(io::CodedInputStream* input, |
| 3232 + UnknownFieldSet* unknown_fields); |
| 3233 + |
| 3234 + // Reads and ignores a message from the input. Skipped values may be stored |
| 3235 + // in the UnknownFieldSet if it exists. |
| 3236 static bool SkipMessage(io::CodedInputStream* input); |
| 3237 |
| 3238 // Reads and ignores a message from the input. Skipped values are recorded |
| 3239 @@ -233,6 +247,48 @@ class LIBPROTOBUF_EXPORT WireFormatLite { |
| 3240 static uint64 ZigZagEncode64(int64 n); |
| 3241 static int64 ZigZagDecode64(uint64 n); |
| 3242 |
| 3243 + // Read a packed enum field. If the is_valid function is not NULL, values for |
| 3244 + // which is_valid(value) returns false are appended to unknown_fields_stream. |
| 3245 + static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream* input, |
| 3246 + uint32 field_number, |
| 3247 + bool (*is_valid)(int), |
| 3248 + UnknownFieldSet* unknown_fields, |
| 3249 + RepeatedField<int>* values); |
| 3250 + |
| 3251 + // Write the contents of an UnknownFieldSet to the output. |
| 3252 + static void SerializeUnknownFields(const UnknownFieldSet& unknown_fields, |
| 3253 + io::CodedOutputStream* output); |
| 3254 + // Same as above, except writing directly to the provided buffer. |
| 3255 + // Requires that the buffer have sufficient capacity for |
| 3256 + // ComputeUnknownFieldsSize(unknown_fields). |
| 3257 + // |
| 3258 + // Returns a pointer past the last written byte. |
| 3259 + static uint8* SerializeUnknownFieldsToArray( |
| 3260 + const UnknownFieldSet& unknown_fields, |
| 3261 + uint8* target); |
| 3262 + |
| 3263 + // Same thing except for messages that have the message_set_wire_format |
| 3264 + // option. |
| 3265 + static void SerializeUnknownMessageSetItems( |
| 3266 + const UnknownFieldSet& unknown_fields, |
| 3267 + io::CodedOutputStream* output); |
| 3268 + // Same as above, except writing directly to the provided buffer. |
| 3269 + // Requires that the buffer have sufficient capacity for |
| 3270 + // ComputeUnknownMessageSetItemsSize(unknown_fields). |
| 3271 + // |
| 3272 + // Returns a pointer past the last written byte. |
| 3273 + static uint8* SerializeUnknownMessageSetItemsToArray( |
| 3274 + const UnknownFieldSet& unknown_fields, |
| 3275 + uint8* target); |
| 3276 + |
| 3277 + // Compute the size of the UnknownFieldSet on the wire. |
| 3278 + static int ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields); |
| 3279 + |
| 3280 + // Same thing except for messages that have the message_set_wire_format |
| 3281 + // option. |
| 3282 + static int ComputeUnknownMessageSetItemsSize( |
| 3283 + const UnknownFieldSet& unknown_fields); |
| 3284 + |
| 3285 // ================================================================= |
| 3286 // Methods for reading/writing individual field. The implementations |
| 3287 // of these methods are defined in wire_format_lite_inl.h; you must #include |
| 3288 @@ -546,26 +602,26 @@ class LIBPROTOBUF_EXPORT WireFormatLite { |
| 3289 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormatLite); |
| 3290 }; |
| 3291 |
| 3292 -// A class which deals with unknown values. The default implementation just |
| 3293 -// discards them. WireFormat defines a subclass which writes to an |
| 3294 -// UnknownFieldSet. This class is used by ExtensionSet::ParseField(), since |
| 3295 -// ExtensionSet is part of the lite library but UnknownFieldSet is not. |
| 3296 +// A class which deals with unknown values by saving them to an UnknownFieldSet
. |
| 3297 class LIBPROTOBUF_EXPORT FieldSkipper { |
| 3298 public: |
| 3299 - FieldSkipper() {} |
| 3300 - virtual ~FieldSkipper() {} |
| 3301 + FieldSkipper(UnknownFieldSet* unknown_fields) |
| 3302 + : unknown_fields_(unknown_fields) {} |
| 3303 |
| 3304 // Skip a field whose tag has already been consumed. |
| 3305 - virtual bool SkipField(io::CodedInputStream* input, uint32 tag); |
| 3306 + bool SkipField(io::CodedInputStream* input, uint32 tag); |
| 3307 |
| 3308 // Skip an entire message or group, up to an end-group tag (which is consumed
) |
| 3309 // or end-of-stream. |
| 3310 - virtual bool SkipMessage(io::CodedInputStream* input); |
| 3311 + bool SkipMessage(io::CodedInputStream* input); |
| 3312 |
| 3313 // Deal with an already-parsed unrecognized enum value. The default |
| 3314 // implementation does nothing, but the UnknownFieldSet-based implementation |
| 3315 // saves it as an unknown varint. |
| 3316 - virtual void SkipUnknownEnum(int field_number, int value); |
| 3317 + void SkipUnknownEnum(int field_number, int value); |
| 3318 + |
| 3319 + private: |
| 3320 + UnknownFieldSet* unknown_fields_; |
| 3321 }; |
| 3322 |
| 3323 // Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream. |
| 3324 @@ -573,7 +629,7 @@ class LIBPROTOBUF_EXPORT FieldSkipper { |
| 3325 class LIBPROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper { |
| 3326 public: |
| 3327 explicit CodedOutputStreamFieldSkipper(io::CodedOutputStream* unknown_fields) |
| 3328 - : unknown_fields_(unknown_fields) {} |
| 3329 + : FieldSkipper(nullptr), unknown_fields_(unknown_fields) {} |
| 3330 virtual ~CodedOutputStreamFieldSkipper() {} |
| 3331 |
| 3332 // implements FieldSkipper ----------------------------------------- |
| OLD | NEW |