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