protobuf/src/google/protobuf/wire_format.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
35 #include <google/protobuf/wire_format.h>
36 
37 #include <stack>
38 #include <string>
39 #include <vector>
40 
41 #include <google/protobuf/stubs/logging.h>
42 #include <google/protobuf/stubs/common.h>
43 #include <google/protobuf/stubs/stringprintf.h>
44 #include <google/protobuf/descriptor.pb.h>
45 #include <google/protobuf/parse_context.h>
46 #include <google/protobuf/io/coded_stream.h>
47 #include <google/protobuf/io/zero_copy_stream.h>
48 #include <google/protobuf/io/zero_copy_stream_impl.h>
49 #include <google/protobuf/descriptor.h>
50 #include <google/protobuf/dynamic_message.h>
51 #include <google/protobuf/map_field.h>
52 #include <google/protobuf/map_field_inl.h>
53 #include <google/protobuf/message.h>
54 #include <google/protobuf/message_lite.h>
55 #include <google/protobuf/unknown_field_set.h>
56 
57 
58 #include <google/protobuf/port_def.inc>
59 
60 const size_t kMapEntryTagByteSize = 2;
61 
62 namespace google {
63 namespace protobuf {
64 namespace internal {
65 
66 // Forward declare static functions
68  const MapValueConstRef& value);
69 
70 // ===================================================================
71 
73  uint32_t tag) {
75 }
76 
79 }
80 
81 void UnknownFieldSetFieldSkipper::SkipUnknownEnum(int field_number, int value) {
82  unknown_fields_->AddVarint(field_number, value);
83 }
84 
86  UnknownFieldSet* unknown_fields) {
88  // Field number 0 is illegal.
89  if (number == 0) return false;
90 
94  if (!input->ReadVarint64(&value)) return false;
95  if (unknown_fields != nullptr) unknown_fields->AddVarint(number, value);
96  return true;
97  }
100  if (!input->ReadLittleEndian64(&value)) return false;
101  if (unknown_fields != nullptr) unknown_fields->AddFixed64(number, value);
102  return true;
103  }
106  if (!input->ReadVarint32(&length)) return false;
107  if (unknown_fields == nullptr) {
108  if (!input->Skip(length)) return false;
109  } else {
110  if (!input->ReadString(unknown_fields->AddLengthDelimited(number),
111  length)) {
112  return false;
113  }
114  }
115  return true;
116  }
118  if (!input->IncrementRecursionDepth()) return false;
119  if (!SkipMessage(input, (unknown_fields == nullptr)
120  ? nullptr
121  : unknown_fields->AddGroup(number))) {
122  return false;
123  }
124  input->DecrementRecursionDepth();
125  // Check that the ending tag matched the starting tag.
126  if (!input->LastTagWas(
129  return false;
130  }
131  return true;
132  }
134  return false;
135  }
137  uint32_t value;
138  if (!input->ReadLittleEndian32(&value)) return false;
139  if (unknown_fields != nullptr) unknown_fields->AddFixed32(number, value);
140  return true;
141  }
142  default: {
143  return false;
144  }
145  }
146 }
147 
149  UnknownFieldSet* unknown_fields) {
150  while (true) {
151  uint32_t tag = input->ReadTag();
152  if (tag == 0) {
153  // End of input. This is a valid place to end, so return true.
154  return true;
155  }
156 
158 
159  if (wire_type == WireFormatLite::WIRETYPE_END_GROUP) {
160  // Must be the end of the message.
161  return true;
162  }
163 
164  if (!SkipField(input, tag, unknown_fields)) return false;
165  }
166 }
167 
169  uint32_t field_number,
170  bool (*is_valid)(int),
171  UnknownFieldSet* unknown_fields,
174  if (!input->ReadVarint32(&length)) return false;
175  io::CodedInputStream::Limit limit = input->PushLimit(length);
176  while (input->BytesUntilLimit() > 0) {
177  int value;
178  if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
179  input, &value)) {
180  return false;
181  }
182  if (is_valid == nullptr || is_valid(value)) {
183  values->Add(value);
184  } else {
185  unknown_fields->AddVarint(field_number, value);
186  }
187  }
188  input->PopLimit(limit);
189  return true;
190 }
191 
193  const UnknownFieldSet& unknown_fields, uint8_t* target,
194  io::EpsCopyOutputStream* stream) {
195  for (int i = 0; i < unknown_fields.field_count(); i++) {
196  const UnknownField& field = unknown_fields.field(i);
197 
198  target = stream->EnsureSpace(target);
199  switch (field.type()) {
202  field.varint(), target);
203  break;
206  field.fixed32(), target);
207  break;
210  field.fixed64(), target);
211  break;
213  target = stream->WriteString(field.number(), field.length_delimited(),
214  target);
215  break;
220  stream);
221  target = stream->EnsureSpace(target);
224  break;
225  }
226  }
227  return target;
228 }
229 
231  const UnknownFieldSet& unknown_fields, uint8_t* target,
232  io::EpsCopyOutputStream* stream) {
233  for (int i = 0; i < unknown_fields.field_count(); i++) {
234  const UnknownField& field = unknown_fields.field(i);
235 
236  // The only unknown fields that are allowed to exist in a MessageSet are
237  // messages, which are length-delimited.
239  target = stream->EnsureSpace(target);
240  // Start group.
243 
244  // Write type ID.
247  target =
249 
250  // Write message.
253 
254  target = field.InternalSerializeLengthDelimitedNoTag(target, stream);
255 
256  target = stream->EnsureSpace(target);
257  // End group.
260  }
261  }
262 
263  return target;
264 }
265 
267  const UnknownFieldSet& unknown_fields) {
268  size_t size = 0;
269  for (int i = 0; i < unknown_fields.field_count(); i++) {
270  const UnknownField& field = unknown_fields.field(i);
271 
272  switch (field.type()) {
277  break;
281  size += sizeof(int32_t);
282  break;
286  size += sizeof(int64_t);
287  break;
292  field.length_delimited().size());
293  size += field.length_delimited().size();
294  break;
298  size += ComputeUnknownFieldsSize(field.group());
301  break;
302  }
303  }
304 
305  return size;
306 }
307 
309  const UnknownFieldSet& unknown_fields) {
310  size_t size = 0;
311  for (int i = 0; i < unknown_fields.field_count(); i++) {
312  const UnknownField& field = unknown_fields.field(i);
313 
314  // The only unknown fields that are allowed to exist in a MessageSet are
315  // messages, which are length-delimited.
319 
320  int field_size = field.GetLengthDelimitedSize();
322  size += field_size;
323  }
324  }
325 
326  return size;
327 }
328 
329 // ===================================================================
330 
332  Message* message) {
333  const Descriptor* descriptor = message->GetDescriptor();
334  const Reflection* message_reflection = message->GetReflection();
335 
336  while (true) {
337  uint32_t tag = input->ReadTag();
338  if (tag == 0) {
339  // End of input. This is a valid place to end, so return true.
340  return true;
341  }
342 
345  // Must be the end of the message.
346  return true;
347  }
348 
349  const FieldDescriptor* field = nullptr;
350 
351  if (descriptor != nullptr) {
352  int field_number = WireFormatLite::GetTagFieldNumber(tag);
353  field = descriptor->FindFieldByNumber(field_number);
354 
355  // If that failed, check if the field is an extension.
356  if (field == nullptr && descriptor->IsExtensionNumber(field_number)) {
357  if (input->GetExtensionPool() == nullptr) {
358  field = message_reflection->FindKnownExtensionByNumber(field_number);
359  } else {
360  field = input->GetExtensionPool()->FindExtensionByNumber(
361  descriptor, field_number);
362  }
363  }
364 
365  // If that failed, but we're a MessageSet, and this is the tag for a
366  // MessageSet item, then parse that.
367  if (field == nullptr && descriptor->options().message_set_wire_format() &&
370  return false;
371  }
372  continue; // Skip ParseAndMergeField(); already taken care of.
373  }
374  }
375 
377  return false;
378  }
379  }
380 }
381 
383  uint32_t field_number,
384  UnknownFieldSet* unknown_fields) {
386  if (!input->ReadVarint32(&length)) return false;
387  return input->ReadString(unknown_fields->AddLengthDelimited(field_number),
388  length);
389 }
390 
392  const FieldDescriptor* field,
393  Message* message,
395  const Reflection* message_reflection = message->GetReflection();
396  if (field == nullptr) {
397  // We store unknown MessageSet extensions as groups.
398  return SkipMessageSetField(
399  input, field_number, message_reflection->MutableUnknownFields(message));
400  } else if (field->is_repeated() ||
402  // This shouldn't happen as we only allow optional message extensions to
403  // MessageSet.
404  GOOGLE_LOG(ERROR) << "Extensions of MessageSets must be optional messages.";
405  return false;
406  } else {
407  Message* sub_message = message_reflection->MutableMessage(
408  message, field, input->GetExtensionFactory());
409  return WireFormatLite::ReadMessage(input, sub_message);
410  }
411 }
412 
413 static bool StrictUtf8Check(const FieldDescriptor* field) {
414  return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3;
415 }
416 
418  uint32_t tag,
419  const FieldDescriptor* field, // May be nullptr for unknown
421  const Reflection* message_reflection = message->GetReflection();
422 
423  enum { UNKNOWN, NORMAL_FORMAT, PACKED_FORMAT } value_format;
424 
425  if (field == nullptr) {
426  value_format = UNKNOWN;
427  } else if (WireFormatLite::GetTagWireType(tag) ==
428  WireTypeForFieldType(field->type())) {
429  value_format = NORMAL_FORMAT;
430  } else if (field->is_packable() &&
433  value_format = PACKED_FORMAT;
434  } else {
435  // We don't recognize this field. Either the field number is unknown
436  // or the wire type doesn't match. Put it in our unknown field set.
437  value_format = UNKNOWN;
438  }
439 
440  if (value_format == UNKNOWN) {
441  return SkipField(input, tag,
442  message_reflection->MutableUnknownFields(message));
443  } else if (value_format == PACKED_FORMAT) {
445  if (!input->ReadVarint32(&length)) return false;
446  io::CodedInputStream::Limit limit = input->PushLimit(length);
447 
448  switch (field->type()) {
449 #define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \
450  case FieldDescriptor::TYPE_##TYPE: { \
451  while (input->BytesUntilLimit() > 0) { \
452  CPPTYPE value; \
453  if (!WireFormatLite::ReadPrimitive<CPPTYPE, \
454  WireFormatLite::TYPE_##TYPE>(input, \
455  &value)) \
456  return false; \
457  message_reflection->Add##CPPTYPE_METHOD(message, field, value); \
458  } \
459  break; \
460  }
461 
468 
471  HANDLE_PACKED_TYPE(SFIXED32, int32_t, Int32)
472  HANDLE_PACKED_TYPE(SFIXED64, int64_t, Int64)
473 
474  HANDLE_PACKED_TYPE(FLOAT, float, Float)
475  HANDLE_PACKED_TYPE(DOUBLE, double, Double)
476 
478 #undef HANDLE_PACKED_TYPE
479 
481  while (input->BytesUntilLimit() > 0) {
482  int value;
483  if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
484  input, &value))
485  return false;
486  if (message->GetDescriptor()->file()->syntax() ==
488  message_reflection->AddEnumValue(message, field, value);
489  } else {
490  const EnumValueDescriptor* enum_value =
491  field->enum_type()->FindValueByNumber(value);
492  if (enum_value != nullptr) {
493  message_reflection->AddEnum(message, field, enum_value);
494  } else {
495  // The enum value is not one of the known values. Add it to the
496  // UnknownFieldSet.
497  int64_t sign_extended_value = static_cast<int64_t>(value);
498  message_reflection->MutableUnknownFields(message)->AddVarint(
499  WireFormatLite::GetTagFieldNumber(tag), sign_extended_value);
500  }
501  }
502  }
503 
504  break;
505  }
506 
511  // Can't have packed fields of these types: these should be caught by
512  // the protocol compiler.
513  return false;
514  break;
515  }
516 
517  input->PopLimit(limit);
518  } else {
519  // Non-packed value (value_format == NORMAL_FORMAT)
520  switch (field->type()) {
521 #define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \
522  case FieldDescriptor::TYPE_##TYPE: { \
523  CPPTYPE value; \
524  if (!WireFormatLite::ReadPrimitive<CPPTYPE, WireFormatLite::TYPE_##TYPE>( \
525  input, &value)) \
526  return false; \
527  if (field->is_repeated()) { \
528  message_reflection->Add##CPPTYPE_METHOD(message, field, value); \
529  } else { \
530  message_reflection->Set##CPPTYPE_METHOD(message, field, value); \
531  } \
532  break; \
533  }
534 
535  HANDLE_TYPE(INT32, int32_t, Int32)
536  HANDLE_TYPE(INT64, int64_t, Int64)
537  HANDLE_TYPE(SINT32, int32_t, Int32)
538  HANDLE_TYPE(SINT64, int64_t, Int64)
539  HANDLE_TYPE(UINT32, uint32_t, UInt32)
540  HANDLE_TYPE(UINT64, uint64_t, UInt64)
541 
542  HANDLE_TYPE(FIXED32, uint32_t, UInt32)
543  HANDLE_TYPE(FIXED64, uint64_t, UInt64)
544  HANDLE_TYPE(SFIXED32, int32_t, Int32)
545  HANDLE_TYPE(SFIXED64, int64_t, Int64)
546 
547  HANDLE_TYPE(FLOAT, float, Float)
548  HANDLE_TYPE(DOUBLE, double, Double)
549 
550  HANDLE_TYPE(BOOL, bool, Bool)
551 #undef HANDLE_TYPE
552 
554  int value;
555  if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
556  input, &value))
557  return false;
558  if (field->is_repeated()) {
559  message_reflection->AddEnumValue(message, field, value);
560  } else {
561  message_reflection->SetEnumValue(message, field, value);
562  }
563  break;
564  }
565 
566  // Handle strings separately so that we can optimize the ctype=CORD case.
568  bool strict_utf8_check = StrictUtf8Check(field);
570  if (!WireFormatLite::ReadString(input, &value)) return false;
571  if (strict_utf8_check) {
572  if (!WireFormatLite::VerifyUtf8String(value.data(), value.length(),
574  field->full_name().c_str())) {
575  return false;
576  }
577  } else {
578  VerifyUTF8StringNamedField(value.data(), value.length(), PARSE,
579  field->full_name().c_str());
580  }
581  if (field->is_repeated()) {
582  message_reflection->AddString(message, field, value);
583  } else {
584  message_reflection->SetString(message, field, value);
585  }
586  break;
587  }
588 
591  if (!WireFormatLite::ReadBytes(input, &value)) return false;
592  if (field->is_repeated()) {
593  message_reflection->AddString(message, field, value);
594  } else {
595  message_reflection->SetString(message, field, value);
596  }
597  break;
598  }
599 
601  Message* sub_message;
602  if (field->is_repeated()) {
603  sub_message = message_reflection->AddMessage(
604  message, field, input->GetExtensionFactory());
605  } else {
606  sub_message = message_reflection->MutableMessage(
607  message, field, input->GetExtensionFactory());
608  }
609 
611  input, sub_message))
612  return false;
613  break;
614  }
615 
617  Message* sub_message;
618  if (field->is_repeated()) {
619  sub_message = message_reflection->AddMessage(
620  message, field, input->GetExtensionFactory());
621  } else {
622  sub_message = message_reflection->MutableMessage(
623  message, field, input->GetExtensionFactory());
624  }
625 
626  if (!WireFormatLite::ReadMessage(input, sub_message)) return false;
627  break;
628  }
629  }
630  }
631 
632  return true;
633 }
634 
636  Message* message) {
637  struct MSReflective {
638  bool ParseField(int type_id, io::CodedInputStream* input) {
639  const FieldDescriptor* field =
640  message_reflection->FindKnownExtensionByNumber(type_id);
641  return ParseAndMergeMessageSetField(type_id, field, message, input);
642  }
643 
645  return WireFormat::SkipField(input, tag, nullptr);
646  }
647 
648  const Reflection* message_reflection;
649  Message* message;
650  };
651 
653  input, MSReflective{message->GetReflection(), message});
654 }
655 
657  const char* _InternalParse(const char* ptr, internal::ParseContext* ctx) {
658  // Parse a MessageSetItem
660  enum class State { kNoTag, kHasType, kHasPayload, kDone };
661  State state = State::kNoTag;
662 
664  uint32_t type_id = 0;
665  while (!ctx->Done(&ptr)) {
666  // We use 64 bit tags in order to allow typeid's that span the whole
667  // range of 32 bit numbers.
668  uint32_t tag = static_cast<uint8_t>(*ptr++);
670  uint64_t tmp;
671  ptr = ParseBigVarint(ptr, &tmp);
673  if (state == State::kNoTag) {
674  type_id = tmp;
675  state = State::kHasType;
676  } else if (state == State::kHasPayload) {
677  type_id = tmp;
678  const FieldDescriptor* field;
679  if (ctx->data().pool == nullptr) {
681  } else {
682  field =
683  ctx->data().pool->FindExtensionByNumber(descriptor, type_id);
684  }
685  if (field == nullptr || field->message_type() == nullptr) {
687  type_id, payload,
688  metadata->mutable_unknown_fields<UnknownFieldSet>());
689  } else {
690  Message* value =
691  field->is_repeated()
692  ? reflection->AddMessage(msg, field, ctx->data().factory)
694  ctx->data().factory);
695  const char* p;
696  // We can't use regular parse from string as we have to track
697  // proper recursion depth and descriptor pools.
698  ParseContext tmp_ctx(ctx->depth(), false, &p, payload);
699  tmp_ctx.data().pool = ctx->data().pool;
700  tmp_ctx.data().factory = ctx->data().factory;
701  GOOGLE_PROTOBUF_PARSER_ASSERT(value->_InternalParse(p, &tmp_ctx) &&
702  tmp_ctx.EndedAtLimit());
703  }
704  state = State::kDone;
705  }
706  continue;
708  if (state == State::kNoTag) {
709  int32_t size = ReadSize(&ptr);
711  ptr = ctx->ReadString(ptr, size, &payload);
713  state = State::kHasPayload;
714  } else if (state == State::kHasType) {
715  // We're now parsing the payload
716  const FieldDescriptor* field = nullptr;
717  if (descriptor->IsExtensionNumber(type_id)) {
718  if (ctx->data().pool == nullptr) {
720  } else {
721  field =
722  ctx->data().pool->FindExtensionByNumber(descriptor, type_id);
723  }
724  }
726  msg, ptr, ctx, static_cast<uint64_t>(type_id) * 8 + 2, reflection,
727  field);
728  state = State::kDone;
729  } else {
730  int32_t size = ReadSize(&ptr);
732  ptr = ctx->Skip(ptr, size);
734  }
735  } else {
736  // An unknown field in MessageSetItem.
737  ptr = ReadTag(ptr - 1, &tag);
738  if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
739  ctx->SetLastTag(tag);
740  return ptr;
741  }
742  // Skip field.
744  tag, static_cast<std::string*>(nullptr), ptr, ctx);
745  }
747  }
748  return ptr;
749  }
750 
751  const char* ParseMessageSet(const char* ptr, internal::ParseContext* ctx) {
752  while (!ctx->Done(&ptr)) {
753  uint32_t tag;
754  ptr = ReadTag(ptr, &tag);
755  if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
756  if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
757  ctx->SetLastTag(tag);
758  break;
759  }
761  // A message set item starts
762  ptr = ctx->ParseGroup(this, ptr, tag);
763  } else {
764  // Parse other fields as normal extensions.
765  int field_number = WireFormatLite::GetTagFieldNumber(tag);
766  const FieldDescriptor* field = nullptr;
767  if (descriptor->IsExtensionNumber(field_number)) {
768  if (ctx->data().pool == nullptr) {
770  } else {
771  field = ctx->data().pool->FindExtensionByNumber(descriptor,
772  field_number);
773  }
774  }
776  reflection, field);
777  }
778  if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
779  }
780  return ptr;
781  }
782 
786 };
787 
788 const char* WireFormat::_InternalParse(Message* msg, const char* ptr,
790  const Descriptor* descriptor = msg->GetDescriptor();
791  const Reflection* reflection = msg->GetReflection();
793  GOOGLE_DCHECK(reflection);
794  if (descriptor->options().message_set_wire_format()) {
795  MessageSetParser message_set{msg, descriptor, reflection};
796  return message_set.ParseMessageSet(ptr, ctx);
797  }
798  while (!ctx->Done(&ptr)) {
799  uint32_t tag;
800  ptr = ReadTag(ptr, &tag);
801  if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
802  if (tag == 0 || (tag & 7) == WireFormatLite::WIRETYPE_END_GROUP) {
803  ctx->SetLastTag(tag);
804  break;
805  }
806  const FieldDescriptor* field = nullptr;
807 
808  int field_number = WireFormatLite::GetTagFieldNumber(tag);
809  field = descriptor->FindFieldByNumber(field_number);
810 
811  // If that failed, check if the field is an extension.
812  if (field == nullptr && descriptor->IsExtensionNumber(field_number)) {
813  if (ctx->data().pool == nullptr) {
814  field = reflection->FindKnownExtensionByNumber(field_number);
815  } else {
816  field =
817  ctx->data().pool->FindExtensionByNumber(descriptor, field_number);
818  }
819  }
820 
821  ptr = _InternalParseAndMergeField(msg, ptr, ctx, tag, reflection, field);
822  if (PROTOBUF_PREDICT_FALSE(ptr == nullptr)) return nullptr;
823  }
824  return ptr;
825 }
826 
829  const Reflection* reflection, const FieldDescriptor* field) {
830  if (field == nullptr) {
831  // unknown field set parser takes 64bit tags, because message set type ids
832  // span the full 32 bit range making the tag span [0, 2^35) range.
834  tag, reflection->MutableUnknownFields(msg), ptr, ctx);
835  }
837  WireTypeForFieldType(field->type())) {
838  if (field->is_packable() && WireFormatLite::GetTagWireType(tag) ==
840  switch (field->type()) {
841 #define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \
842  case FieldDescriptor::TYPE_##TYPE: { \
843  ptr = internal::Packed##CPPTYPE_METHOD##Parser( \
844  reflection->MutableRepeatedFieldInternal<CPPTYPE>(msg, field), ptr, \
845  ctx); \
846  return ptr; \
847  }
848 
851  HANDLE_PACKED_TYPE(SINT32, int32_t, SInt32)
852  HANDLE_PACKED_TYPE(SINT64, int64_t, SInt64)
855 
858  HANDLE_PACKED_TYPE(SFIXED32, int32_t, SFixed32)
859  HANDLE_PACKED_TYPE(SFIXED64, int64_t, SFixed64)
860 
861  HANDLE_PACKED_TYPE(FLOAT, float, Float)
862  HANDLE_PACKED_TYPE(DOUBLE, double, Double)
863 
865 #undef HANDLE_PACKED_TYPE
866 
868  auto rep_enum =
869  reflection->MutableRepeatedFieldInternal<int>(msg, field);
870  bool open_enum = false;
871  if (field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
872  open_enum) {
873  ptr = internal::PackedEnumParser(rep_enum, ptr, ctx);
874  } else {
875  return ctx->ReadPackedVarint(
876  ptr, [rep_enum, field, reflection, msg](uint64_t val) {
877  if (field->enum_type()->FindValueByNumber(val) != nullptr) {
878  rep_enum->Add(val);
879  } else {
880  WriteVarint(field->number(), val,
881  reflection->MutableUnknownFields(msg));
882  }
883  });
884  }
885  return ptr;
886  }
887 
892  GOOGLE_LOG(FATAL) << "Can't reach";
893  return nullptr;
894  }
895  } else {
896  // mismatched wiretype;
898  tag, reflection->MutableUnknownFields(msg), ptr, ctx);
899  }
900  }
901 
902  // Non-packed value
903  bool utf8_check = false;
904  bool strict_utf8_check = false;
905  switch (field->type()) {
906 #define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \
907  case FieldDescriptor::TYPE_##TYPE: { \
908  CPPTYPE value; \
909  ptr = VarintParse(ptr, &value); \
910  if (ptr == nullptr) return nullptr; \
911  if (field->is_repeated()) { \
912  reflection->Add##CPPTYPE_METHOD(msg, field, value); \
913  } else { \
914  reflection->Set##CPPTYPE_METHOD(msg, field, value); \
915  } \
916  return ptr; \
917  }
918 
920  HANDLE_TYPE(INT32, uint32_t, Int32)
921  HANDLE_TYPE(INT64, uint64_t, Int64)
922  HANDLE_TYPE(UINT32, uint32_t, UInt32)
923  HANDLE_TYPE(UINT64, uint64_t, UInt64)
924 
927  if (ptr == nullptr) return nullptr;
928  if (field->is_repeated()) {
929  reflection->AddInt32(msg, field, value);
930  } else {
931  reflection->SetInt32(msg, field, value);
932  }
933  return ptr;
934  }
937  if (ptr == nullptr) return nullptr;
938  if (field->is_repeated()) {
939  reflection->AddInt64(msg, field, value);
940  } else {
941  reflection->SetInt64(msg, field, value);
942  }
943  return ptr;
944  }
945 #undef HANDLE_TYPE
946 #define HANDLE_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD) \
947  case FieldDescriptor::TYPE_##TYPE: { \
948  CPPTYPE value; \
949  value = UnalignedLoad<CPPTYPE>(ptr); \
950  ptr += sizeof(CPPTYPE); \
951  if (field->is_repeated()) { \
952  reflection->Add##CPPTYPE_METHOD(msg, field, value); \
953  } else { \
954  reflection->Set##CPPTYPE_METHOD(msg, field, value); \
955  } \
956  return ptr; \
957  }
958 
959  HANDLE_TYPE(FIXED32, uint32_t, UInt32)
960  HANDLE_TYPE(FIXED64, uint64_t, UInt64)
961  HANDLE_TYPE(SFIXED32, int32_t, Int32)
962  HANDLE_TYPE(SFIXED64, int64_t, Int64)
963 
964  HANDLE_TYPE(FLOAT, float, Float)
965  HANDLE_TYPE(DOUBLE, double, Double)
966 
967 #undef HANDLE_TYPE
968 
970  uint32_t value;
971  ptr = VarintParse(ptr, &value);
972  if (ptr == nullptr) return nullptr;
973  if (field->is_repeated()) {
974  reflection->AddEnumValue(msg, field, value);
975  } else {
976  reflection->SetEnumValue(msg, field, value);
977  }
978  return ptr;
979  }
980 
981  // Handle strings separately so that we can optimize the ctype=CORD case.
983  utf8_check = true;
984  strict_utf8_check = StrictUtf8Check(field);
985  PROTOBUF_FALLTHROUGH_INTENDED;
987  int size = ReadSize(&ptr);
988  if (ptr == nullptr) return nullptr;
990  ptr = ctx->ReadString(ptr, size, &value);
991  if (ptr == nullptr) return nullptr;
992  if (utf8_check) {
993  if (strict_utf8_check) {
994  if (!WireFormatLite::VerifyUtf8String(value.data(), value.length(),
996  field->full_name().c_str())) {
997  return nullptr;
998  }
999  } else {
1000  VerifyUTF8StringNamedField(value.data(), value.length(), PARSE,
1001  field->full_name().c_str());
1002  }
1003  }
1004  if (field->is_repeated()) {
1005  reflection->AddString(msg, field, std::move(value));
1006  } else {
1007  reflection->SetString(msg, field, std::move(value));
1008  }
1009  return ptr;
1010  }
1011 
1013  Message* sub_message;
1014  if (field->is_repeated()) {
1015  sub_message = reflection->AddMessage(msg, field, ctx->data().factory);
1016  } else {
1017  sub_message =
1018  reflection->MutableMessage(msg, field, ctx->data().factory);
1019  }
1020 
1021  return ctx->ParseGroup(sub_message, ptr, tag);
1022  }
1023 
1025  Message* sub_message;
1026  if (field->is_repeated()) {
1027  sub_message = reflection->AddMessage(msg, field, ctx->data().factory);
1028  } else {
1029  sub_message =
1030  reflection->MutableMessage(msg, field, ctx->data().factory);
1031  }
1032  return ctx->ParseMessage(sub_message, ptr);
1033  }
1034  }
1035 
1036  // GCC 8 complains about control reaching end of non-void function here.
1037  // Let's keep it happy by returning a nullptr.
1038  return nullptr;
1039 }
1040 
1041 // ===================================================================
1042 
1045  const Descriptor* descriptor = message.GetDescriptor();
1046  const Reflection* message_reflection = message.GetReflection();
1047 
1048  std::vector<const FieldDescriptor*> fields;
1049 
1050  // Fields of map entry should always be serialized.
1051  if (descriptor->options().map_entry()) {
1052  for (int i = 0; i < descriptor->field_count(); i++) {
1053  fields.push_back(descriptor->field(i));
1054  }
1055  } else {
1056  message_reflection->ListFields(message, &fields);
1057  }
1058 
1059  for (auto field : fields) {
1061  }
1062 
1063  if (descriptor->options().message_set_wire_format()) {
1065  message_reflection->GetUnknownFields(message), target, stream);
1066  } else {
1068  message_reflection->GetUnknownFields(message), target, stream);
1069  }
1070 }
1071 
1073  const MapKey& value, uint8_t* target,
1075  target = stream->EnsureSpace(target);
1076  switch (field->type()) {
1083  GOOGLE_LOG(FATAL) << "Unsupported";
1084  break;
1085 #define CASE_TYPE(FieldType, CamelFieldType, CamelCppType) \
1086  case FieldDescriptor::TYPE_##FieldType: \
1087  target = WireFormatLite::Write##CamelFieldType##ToArray( \
1088  1, value.Get##CamelCppType##Value(), target); \
1089  break;
1090  CASE_TYPE(INT64, Int64, Int64)
1091  CASE_TYPE(UINT64, UInt64, UInt64)
1092  CASE_TYPE(INT32, Int32, Int32)
1093  CASE_TYPE(FIXED64, Fixed64, UInt64)
1094  CASE_TYPE(FIXED32, Fixed32, UInt32)
1095  CASE_TYPE(BOOL, Bool, Bool)
1096  CASE_TYPE(UINT32, UInt32, UInt32)
1097  CASE_TYPE(SFIXED32, SFixed32, Int32)
1098  CASE_TYPE(SFIXED64, SFixed64, Int64)
1099  CASE_TYPE(SINT32, SInt32, Int32)
1100  CASE_TYPE(SINT64, SInt64, Int64)
1101 #undef CASE_TYPE
1103  target = stream->WriteString(1, value.GetStringValue(), target);
1104  break;
1105  }
1106  return target;
1107 }
1108 
1112  target = stream->EnsureSpace(target);
1113  switch (field->type()) {
1114 #define CASE_TYPE(FieldType, CamelFieldType, CamelCppType) \
1115  case FieldDescriptor::TYPE_##FieldType: \
1116  target = WireFormatLite::Write##CamelFieldType##ToArray( \
1117  2, value.Get##CamelCppType##Value(), target); \
1118  break;
1119  CASE_TYPE(INT64, Int64, Int64)
1120  CASE_TYPE(UINT64, UInt64, UInt64)
1121  CASE_TYPE(INT32, Int32, Int32)
1122  CASE_TYPE(FIXED64, Fixed64, UInt64)
1123  CASE_TYPE(FIXED32, Fixed32, UInt32)
1124  CASE_TYPE(BOOL, Bool, Bool)
1125  CASE_TYPE(UINT32, UInt32, UInt32)
1126  CASE_TYPE(SFIXED32, SFixed32, Int32)
1127  CASE_TYPE(SFIXED64, SFixed64, Int64)
1128  CASE_TYPE(SINT32, SInt32, Int32)
1129  CASE_TYPE(SINT64, SInt64, Int64)
1130  CASE_TYPE(ENUM, Enum, Enum)
1131  CASE_TYPE(DOUBLE, Double, Double)
1132  CASE_TYPE(FLOAT, Float, Float)
1133 #undef CASE_TYPE
1136  target = stream->WriteString(2, value.GetStringValue(), target);
1137  break;
1139  target = WireFormatLite::InternalWriteMessage(2, value.GetMessageValue(),
1140  target, stream);
1141  break;
1143  target = WireFormatLite::InternalWriteGroup(2, value.GetMessageValue(),
1144  target, stream);
1145  break;
1146  }
1147  return target;
1148 }
1149 
1150 class MapKeySorter {
1151  public:
1152  static std::vector<MapKey> SortKey(const Message& message,
1153  const Reflection* reflection,
1154  const FieldDescriptor* field) {
1155  std::vector<MapKey> sorted_key_list;
1156  for (MapIterator it =
1157  reflection->MapBegin(const_cast<Message*>(&message), field);
1158  it != reflection->MapEnd(const_cast<Message*>(&message), field);
1159  ++it) {
1160  sorted_key_list.push_back(it.GetKey());
1161  }
1162  MapKeyComparator comparator;
1163  std::sort(sorted_key_list.begin(), sorted_key_list.end(), comparator);
1164  return sorted_key_list;
1165  }
1166 
1167  private:
1168  class MapKeyComparator {
1169  public:
1170  bool operator()(const MapKey& a, const MapKey& b) const {
1171  GOOGLE_DCHECK(a.type() == b.type());
1172  switch (a.type()) {
1173 #define CASE_TYPE(CppType, CamelCppType) \
1174  case FieldDescriptor::CPPTYPE_##CppType: { \
1175  return a.Get##CamelCppType##Value() < b.Get##CamelCppType##Value(); \
1176  }
1177  CASE_TYPE(STRING, String)
1178  CASE_TYPE(INT64, Int64)
1179  CASE_TYPE(INT32, Int32)
1180  CASE_TYPE(UINT64, UInt64)
1181  CASE_TYPE(UINT32, UInt32)
1182  CASE_TYPE(BOOL, Bool)
1183 #undef CASE_TYPE
1184 
1185  default:
1186  GOOGLE_LOG(DFATAL) << "Invalid key for map field.";
1187  return true;
1188  }
1189  }
1190  };
1191 };
1192 
1194  const MapKey& key,
1195  const MapValueConstRef& value,
1196  uint8_t* target,
1198  const FieldDescriptor* key_field = field->message_type()->field(0);
1199  const FieldDescriptor* value_field = field->message_type()->field(1);
1200 
1201  size_t size = kMapEntryTagByteSize;
1202  size += MapKeyDataOnlyByteSize(key_field, key);
1203  size += MapValueRefDataOnlyByteSize(value_field, value);
1204  target = stream->EnsureSpace(target);
1209  target =
1211  return target;
1212 }
1213 
1215  const Message& message,
1216  uint8_t* target,
1218  const Reflection* message_reflection = message.GetReflection();
1219 
1220  if (field->is_extension() &&
1221  field->containing_type()->options().message_set_wire_format() &&
1222  field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
1223  !field->is_repeated()) {
1225  }
1226 
1227  // For map fields, we can use either repeated field reflection or map
1228  // reflection. Our choice has some subtle effects. If we use repeated field
1229  // reflection here, then the repeated field representation becomes
1230  // authoritative for this field: any existing references that came from map
1231  // reflection remain valid for reading, but mutations to them are lost and
1232  // will be overwritten next time we call map reflection!
1233  //
1234  // So far this mainly affects Python, which keeps long-term references to map
1235  // values around, and always uses map reflection. See: b/35918691
1236  //
1237  // Here we choose to use map reflection API as long as the internal
1238  // map is valid. In this way, the serialization doesn't change map field's
1239  // internal state and existing references that came from map reflection remain
1240  // valid for both reading and writing.
1241  if (field->is_map()) {
1242  const MapFieldBase* map_field =
1243  message_reflection->GetMapData(message, field);
1244  if (map_field->IsMapValid()) {
1245  if (stream->IsSerializationDeterministic()) {
1246  std::vector<MapKey> sorted_key_list =
1247  MapKeySorter::SortKey(message, message_reflection, field);
1248  for (std::vector<MapKey>::iterator it = sorted_key_list.begin();
1249  it != sorted_key_list.end(); ++it) {
1250  MapValueConstRef map_value;
1251  message_reflection->LookupMapValue(message, field, *it, &map_value);
1252  target =
1254  }
1255  } else {
1256  for (MapIterator it = message_reflection->MapBegin(
1257  const_cast<Message*>(&message), field);
1258  it !=
1259  message_reflection->MapEnd(const_cast<Message*>(&message), field);
1260  ++it) {
1262  it.GetValueRef(), target, stream);
1263  }
1264  }
1265 
1266  return target;
1267  }
1268  }
1269  int count = 0;
1270 
1271  if (field->is_repeated()) {
1272  count = message_reflection->FieldSize(message, field);
1273  } else if (field->containing_type()->options().map_entry()) {
1274  // Map entry fields always need to be serialized.
1275  count = 1;
1276  } else if (message_reflection->HasField(message, field)) {
1277  count = 1;
1278  }
1279 
1280  // map_entries is for maps that'll be deterministically serialized.
1281  std::vector<const Message*> map_entries;
1282  if (count > 1 && field->is_map() && stream->IsSerializationDeterministic()) {
1283  map_entries =
1284  DynamicMapSorter::Sort(message, count, message_reflection, field);
1285  }
1286 
1287  if (field->is_packed()) {
1288  if (count == 0) return target;
1289  target = stream->EnsureSpace(target);
1290  switch (field->type()) {
1291 #define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD) \
1292  case FieldDescriptor::TYPE_##TYPE: { \
1293  auto r = \
1294  message_reflection->GetRepeatedFieldInternal<CPPTYPE>(message, field); \
1295  target = stream->Write##TYPE_METHOD##Packed( \
1296  field->number(), r, FieldDataOnlyByteSize(field, message), target); \
1297  break; \
1298  }
1299 
1302  HANDLE_PRIMITIVE_TYPE(SINT32, int32_t, SInt32, Int32)
1303  HANDLE_PRIMITIVE_TYPE(SINT64, int64_t, SInt64, Int64)
1306  HANDLE_PRIMITIVE_TYPE(ENUM, int, Enum, Enum)
1307 
1308 #undef HANDLE_PRIMITIVE_TYPE
1309 #define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD) \
1310  case FieldDescriptor::TYPE_##TYPE: { \
1311  auto r = \
1312  message_reflection->GetRepeatedFieldInternal<CPPTYPE>(message, field); \
1313  target = stream->WriteFixedPacked(field->number(), r, target); \
1314  break; \
1315  }
1316 
1319  HANDLE_PRIMITIVE_TYPE(SFIXED32, int32_t, SFixed32, Int32)
1320  HANDLE_PRIMITIVE_TYPE(SFIXED64, int64_t, SFixed64, Int64)
1321 
1322  HANDLE_PRIMITIVE_TYPE(FLOAT, float, Float, Float)
1323  HANDLE_PRIMITIVE_TYPE(DOUBLE, double, Double, Double)
1324 
1326 #undef HANDLE_PRIMITIVE_TYPE
1327  default:
1328  GOOGLE_LOG(FATAL) << "Invalid descriptor";
1329  }
1330  return target;
1331  }
1332 
1333  for (int j = 0; j < count; j++) {
1334  target = stream->EnsureSpace(target);
1335  switch (field->type()) {
1336 #define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD) \
1337  case FieldDescriptor::TYPE_##TYPE: { \
1338  const CPPTYPE value = \
1339  field->is_repeated() \
1340  ? message_reflection->GetRepeated##CPPTYPE_METHOD(message, field, \
1341  j) \
1342  : message_reflection->Get##CPPTYPE_METHOD(message, field); \
1343  target = WireFormatLite::Write##TYPE_METHOD##ToArray(field->number(), \
1344  value, target); \
1345  break; \
1346  }
1347 
1350  HANDLE_PRIMITIVE_TYPE(SINT32, int32_t, SInt32, Int32)
1351  HANDLE_PRIMITIVE_TYPE(SINT64, int64_t, SInt64, Int64)
1354 
1357  HANDLE_PRIMITIVE_TYPE(SFIXED32, int32_t, SFixed32, Int32)
1358  HANDLE_PRIMITIVE_TYPE(SFIXED64, int64_t, SFixed64, Int64)
1359 
1360  HANDLE_PRIMITIVE_TYPE(FLOAT, float, Float, Float)
1361  HANDLE_PRIMITIVE_TYPE(DOUBLE, double, Double, Double)
1362 
1364 #undef HANDLE_PRIMITIVE_TYPE
1365 
1366 #define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD) \
1367  case FieldDescriptor::TYPE_##TYPE: \
1368  target = WireFormatLite::InternalWrite##TYPE_METHOD( \
1369  field->number(), \
1370  field->is_repeated() \
1371  ? (map_entries.empty() \
1372  ? message_reflection->GetRepeated##CPPTYPE_METHOD(message, \
1373  field, j) \
1374  : *map_entries[j]) \
1375  : message_reflection->Get##CPPTYPE_METHOD(message, field), \
1376  target, stream); \
1377  break;
1378 
1381 #undef HANDLE_TYPE
1382 
1384  const EnumValueDescriptor* value =
1385  field->is_repeated()
1386  ? message_reflection->GetRepeatedEnum(message, field, j)
1387  : message_reflection->GetEnum(message, field);
1389  value->number(), target);
1390  break;
1391  }
1392 
1393  // Handle strings separately so that we can get string references
1394  // instead of copying.
1396  bool strict_utf8_check = StrictUtf8Check(field);
1398  const std::string& value =
1399  field->is_repeated()
1400  ? message_reflection->GetRepeatedStringReference(message, field,
1401  j, &scratch)
1402  : message_reflection->GetStringReference(message, field,
1403  &scratch);
1404  if (strict_utf8_check) {
1405  WireFormatLite::VerifyUtf8String(value.data(), value.length(),
1407  field->full_name().c_str());
1408  } else {
1409  VerifyUTF8StringNamedField(value.data(), value.length(), SERIALIZE,
1410  field->full_name().c_str());
1411  }
1412  target = stream->WriteString(field->number(), value, target);
1413  break;
1414  }
1415 
1418  const std::string& value =
1419  field->is_repeated()
1420  ? message_reflection->GetRepeatedStringReference(message, field,
1421  j, &scratch)
1422  : message_reflection->GetStringReference(message, field,
1423  &scratch);
1424  target = stream->WriteString(field->number(), value, target);
1425  break;
1426  }
1427  }
1428  }
1429  return target;
1430 }
1431 
1434  io::EpsCopyOutputStream* stream) {
1435  const Reflection* message_reflection = message.GetReflection();
1436 
1437  target = stream->EnsureSpace(target);
1438  // Start group.
1441  // Write type ID.
1444  // Write message.
1447  message_reflection->GetMessage(message, field), target, stream);
1448  // End group.
1449  target = stream->EnsureSpace(target);
1452  return target;
1453 }
1454 
1455 // ===================================================================
1456 
1457 size_t WireFormat::ByteSize(const Message& message) {
1458  const Descriptor* descriptor = message.GetDescriptor();
1459  const Reflection* message_reflection = message.GetReflection();
1460 
1461  size_t our_size = 0;
1462 
1463  std::vector<const FieldDescriptor*> fields;
1464 
1465  // Fields of map entry should always be serialized.
1466  if (descriptor->options().map_entry()) {
1467  for (int i = 0; i < descriptor->field_count(); i++) {
1468  fields.push_back(descriptor->field(i));
1469  }
1470  } else {
1471  message_reflection->ListFields(message, &fields);
1472  }
1473 
1474  for (const FieldDescriptor* field : fields) {
1475  our_size += FieldByteSize(field, message);
1476  }
1477 
1478  if (descriptor->options().message_set_wire_format()) {
1480  message_reflection->GetUnknownFields(message));
1481  } else {
1482  our_size +=
1483  ComputeUnknownFieldsSize(message_reflection->GetUnknownFields(message));
1484  }
1485 
1486  return our_size;
1487 }
1488 
1490  const Message& message) {
1491  const Reflection* message_reflection = message.GetReflection();
1492 
1493  if (field->is_extension() &&
1494  field->containing_type()->options().message_set_wire_format() &&
1495  field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
1496  !field->is_repeated()) {
1498  }
1499 
1500  size_t count = 0;
1501  if (field->is_repeated()) {
1502  if (field->is_map()) {
1503  const MapFieldBase* map_field =
1504  message_reflection->GetMapData(message, field);
1505  if (map_field->IsMapValid()) {
1506  count = FromIntSize(map_field->size());
1507  } else {
1508  count = FromIntSize(message_reflection->FieldSize(message, field));
1509  }
1510  } else {
1511  count = FromIntSize(message_reflection->FieldSize(message, field));
1512  }
1513  } else if (field->containing_type()->options().map_entry()) {
1514  // Map entry fields always need to be serialized.
1515  count = 1;
1516  } else if (message_reflection->HasField(message, field)) {
1517  count = 1;
1518  }
1519 
1520  const size_t data_size = FieldDataOnlyByteSize(field, message);
1521  size_t our_size = data_size;
1522  if (field->is_packed()) {
1523  if (data_size > 0) {
1524  // Packed fields get serialized like a string, not their native type.
1525  // Technically this doesn't really matter; the size only changes if it's
1526  // a GROUP
1527  our_size += TagSize(field->number(), FieldDescriptor::TYPE_STRING);
1528  our_size += io::CodedOutputStream::VarintSize32(data_size);
1529  }
1530  } else {
1531  our_size += count * TagSize(field->number(), field->type());
1532  }
1533  return our_size;
1534 }
1535 
1537  const MapKey& value) {
1539  switch (field->type()) {
1546  GOOGLE_LOG(FATAL) << "Unsupported";
1547  return 0;
1548 #define CASE_TYPE(FieldType, CamelFieldType, CamelCppType) \
1549  case FieldDescriptor::TYPE_##FieldType: \
1550  return WireFormatLite::CamelFieldType##Size( \
1551  value.Get##CamelCppType##Value());
1552 
1553 #define FIXED_CASE_TYPE(FieldType, CamelFieldType) \
1554  case FieldDescriptor::TYPE_##FieldType: \
1555  return WireFormatLite::k##CamelFieldType##Size;
1556 
1557  CASE_TYPE(INT32, Int32, Int32);
1558  CASE_TYPE(INT64, Int64, Int64);
1559  CASE_TYPE(UINT32, UInt32, UInt32);
1560  CASE_TYPE(UINT64, UInt64, UInt64);
1561  CASE_TYPE(SINT32, SInt32, Int32);
1562  CASE_TYPE(SINT64, SInt64, Int64);
1563  CASE_TYPE(STRING, String, String);
1564  FIXED_CASE_TYPE(FIXED32, Fixed32);
1565  FIXED_CASE_TYPE(FIXED64, Fixed64);
1566  FIXED_CASE_TYPE(SFIXED32, SFixed32);
1567  FIXED_CASE_TYPE(SFIXED64, SFixed64);
1569 
1570 #undef CASE_TYPE
1571 #undef FIXED_CASE_TYPE
1572  }
1573  GOOGLE_LOG(FATAL) << "Cannot get here";
1574  return 0;
1575 }
1576 
1578  const MapValueConstRef& value) {
1579  switch (field->type()) {
1581  GOOGLE_LOG(FATAL) << "Unsupported";
1582  return 0;
1583 #define CASE_TYPE(FieldType, CamelFieldType, CamelCppType) \
1584  case FieldDescriptor::TYPE_##FieldType: \
1585  return WireFormatLite::CamelFieldType##Size( \
1586  value.Get##CamelCppType##Value());
1587 
1588 #define FIXED_CASE_TYPE(FieldType, CamelFieldType) \
1589  case FieldDescriptor::TYPE_##FieldType: \
1590  return WireFormatLite::k##CamelFieldType##Size;
1591 
1592  CASE_TYPE(INT32, Int32, Int32);
1593  CASE_TYPE(INT64, Int64, Int64);
1594  CASE_TYPE(UINT32, UInt32, UInt32);
1595  CASE_TYPE(UINT64, UInt64, UInt64);
1596  CASE_TYPE(SINT32, SInt32, Int32);
1597  CASE_TYPE(SINT64, SInt64, Int64);
1598  CASE_TYPE(STRING, String, String);
1599  CASE_TYPE(BYTES, Bytes, String);
1600  CASE_TYPE(ENUM, Enum, Enum);
1602  FIXED_CASE_TYPE(FIXED32, Fixed32);
1603  FIXED_CASE_TYPE(FIXED64, Fixed64);
1604  FIXED_CASE_TYPE(SFIXED32, SFixed32);
1605  FIXED_CASE_TYPE(SFIXED64, SFixed64);
1606  FIXED_CASE_TYPE(DOUBLE, Double);
1607  FIXED_CASE_TYPE(FLOAT, Float);
1609 
1610 #undef CASE_TYPE
1611 #undef FIXED_CASE_TYPE
1612  }
1613  GOOGLE_LOG(FATAL) << "Cannot get here";
1614  return 0;
1615 }
1616 
1618  const Message& message) {
1619  const Reflection* message_reflection = message.GetReflection();
1620 
1621  size_t data_size = 0;
1622 
1623  if (field->is_map()) {
1624  const MapFieldBase* map_field =
1625  message_reflection->GetMapData(message, field);
1626  if (map_field->IsMapValid()) {
1627  MapIterator iter(const_cast<Message*>(&message), field);
1628  MapIterator end(const_cast<Message*>(&message), field);
1629  const FieldDescriptor* key_field = field->message_type()->field(0);
1630  const FieldDescriptor* value_field = field->message_type()->field(1);
1631  for (map_field->MapBegin(&iter), map_field->MapEnd(&end); iter != end;
1632  ++iter) {
1633  size_t size = kMapEntryTagByteSize;
1634  size += MapKeyDataOnlyByteSize(key_field, iter.GetKey());
1635  size += MapValueRefDataOnlyByteSize(value_field, iter.GetValueRef());
1637  }
1638  return data_size;
1639  }
1640  }
1641 
1642  size_t count = 0;
1643  if (field->is_repeated()) {
1644  count =
1645  internal::FromIntSize(message_reflection->FieldSize(message, field));
1646  } else if (field->containing_type()->options().map_entry()) {
1647  // Map entry fields always need to be serialized.
1648  count = 1;
1649  } else if (message_reflection->HasField(message, field)) {
1650  count = 1;
1651  }
1652 
1653  switch (field->type()) {
1654 #define HANDLE_TYPE(TYPE, TYPE_METHOD, CPPTYPE_METHOD) \
1655  case FieldDescriptor::TYPE_##TYPE: \
1656  if (field->is_repeated()) { \
1657  for (size_t j = 0; j < count; j++) { \
1658  data_size += WireFormatLite::TYPE_METHOD##Size( \
1659  message_reflection->GetRepeated##CPPTYPE_METHOD(message, field, \
1660  j)); \
1661  } \
1662  } else { \
1663  data_size += WireFormatLite::TYPE_METHOD##Size( \
1664  message_reflection->Get##CPPTYPE_METHOD(message, field)); \
1665  } \
1666  break;
1667 
1668 #define HANDLE_FIXED_TYPE(TYPE, TYPE_METHOD) \
1669  case FieldDescriptor::TYPE_##TYPE: \
1670  data_size += count * WireFormatLite::k##TYPE_METHOD##Size; \
1671  break;
1672 
1673  HANDLE_TYPE(INT32, Int32, Int32)
1674  HANDLE_TYPE(INT64, Int64, Int64)
1675  HANDLE_TYPE(SINT32, SInt32, Int32)
1676  HANDLE_TYPE(SINT64, SInt64, Int64)
1677  HANDLE_TYPE(UINT32, UInt32, UInt32)
1678  HANDLE_TYPE(UINT64, UInt64, UInt64)
1679 
1680  HANDLE_FIXED_TYPE(FIXED32, Fixed32)
1681  HANDLE_FIXED_TYPE(FIXED64, Fixed64)
1682  HANDLE_FIXED_TYPE(SFIXED32, SFixed32)
1683  HANDLE_FIXED_TYPE(SFIXED64, SFixed64)
1684 
1685  HANDLE_FIXED_TYPE(FLOAT, Float)
1686  HANDLE_FIXED_TYPE(DOUBLE, Double)
1687 
1689 
1692 #undef HANDLE_TYPE
1693 #undef HANDLE_FIXED_TYPE
1694 
1696  if (field->is_repeated()) {
1697  for (size_t j = 0; j < count; j++) {
1698  data_size += WireFormatLite::EnumSize(
1699  message_reflection->GetRepeatedEnum(message, field, j)->number());
1700  }
1701  } else {
1702  data_size += WireFormatLite::EnumSize(
1703  message_reflection->GetEnum(message, field)->number());
1704  }
1705  break;
1706  }
1707 
1708  // Handle strings separately so that we can get string references
1709  // instead of copying.
1712  for (size_t j = 0; j < count; j++) {
1714  const std::string& value =
1715  field->is_repeated()
1716  ? message_reflection->GetRepeatedStringReference(message, field,
1717  j, &scratch)
1718  : message_reflection->GetStringReference(message, field,
1719  &scratch);
1720  data_size += WireFormatLite::StringSize(value);
1721  }
1722  break;
1723  }
1724  }
1725  return data_size;
1726 }
1727 
1729  const Message& message) {
1730  const Reflection* message_reflection = message.GetReflection();
1731 
1732  size_t our_size = WireFormatLite::kMessageSetItemTagsSize;
1733 
1734  // type_id
1735  our_size += io::CodedOutputStream::VarintSize32(field->number());
1736 
1737  // message
1738  const Message& sub_message = message_reflection->GetMessage(message, field);
1739  size_t message_size = sub_message.ByteSizeLong();
1740 
1741  our_size += io::CodedOutputStream::VarintSize32(message_size);
1742  our_size += message_size;
1743 
1744  return our_size;
1745 }
1746 
1747 // Compute the size of the UnknownFieldSet on the wire.
1749  size_t total_size, CachedSize* cached_size) {
1751  metadata.unknown_fields<UnknownFieldSet>(
1753  cached_size->Set(ToCachedSize(total_size));
1754  return total_size;
1755 }
1756 
1757 } // namespace internal
1758 } // namespace protobuf
1759 } // namespace google
1760 
1761 #include <google/protobuf/port_undef.inc>
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
google::protobuf.internal::WireFormat::ReadPackedEnumPreserveUnknowns
static bool ReadPackedEnumPreserveUnknowns(io::CodedInputStream *input, uint32 field_number, bool(*is_valid)(int), UnknownFieldSet *unknown_fields, RepeatedField< int > *values)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:168
google::protobuf.internal::ReadVarintZigZag64
int64 ReadVarintZigZag64(const char **p)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:584
google::protobuf.internal::ReadTag
const char * ReadTag(const char *p, uint32 *out, uint32 max_tag=0)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:494
google::protobuf.internal::WireFormatLite::EnumSize
static size_t EnumSize(int value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1763
google::protobuf.internal::WireFormat::_InternalParse
static const char * _InternalParse(Message *msg, const char *ptr, internal::ParseContext *ctx)
Definition: protobuf/src/google/protobuf/wire_format.cc:788
google::protobuf::Reflection::GetStringReference
const std::string & GetStringReference(const Message &message, const FieldDescriptor *field, std::string *scratch) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1171
google::protobuf.internal::WireFormatLite::ReadGroup
static bool ReadGroup(int field_number, io::CodedInputStream *input, MessageType *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1262
google::protobuf.internal::WireFormat::MessageSetItemByteSize
static size_t MessageSetItemByteSize(const FieldDescriptor *field, const Message &message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1330
google::protobuf.internal::WireFormatLite::ReadBytes
static bool ReadBytes(io::CodedInputStream *input, std::string *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.cc:559
FIXED_CASE_TYPE
#define FIXED_CASE_TYPE(FieldType, CamelFieldType)
MESSAGE
static const char MESSAGE[]
Definition: test-callback-stack.c:31
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
Bytes
Definition: boringssl-with-bazel/src/crypto/test/test_util.h:38
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf.internal::ReadSize
uint32 ReadSize(const char **pp)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:561
absl::str_format_internal::LengthMod::j
@ j
HANDLE_FIXED_TYPE
#define HANDLE_FIXED_TYPE(TYPE, TYPE_METHOD)
google::protobuf::Descriptor::IsExtensionNumber
bool IsExtensionNumber(int number) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2010
google::protobuf.internal::WireFormat::TagSize
static size_t TagSize(int field_number, FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:331
google::protobuf.internal::WireFormat::MessageSetParser
Definition: protobuf/src/google/protobuf/wire_format.cc:656
ctx
Definition: benchmark-async.c:30
google::protobuf.internal::WireFormat::PARSE
@ PARSE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:264
testing::internal::Int32
TypeWithSize< 4 >::Int Int32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2159
metadata
Definition: cq_verifier.cc:48
Bool
Definition: bloaty/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc:56
google::protobuf.internal::WireFormatLite::WriteUInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32ToArray(int field_number, uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1541
Group
TypeAndValue Group(UnknownFields nested)
Definition: upb/upb/util/compare_test.cc:101
google::protobuf::UnknownField::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:223
google::protobuf::io::CodedOutputStream::VarintSize64
static size_t VarintSize64(uint64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1664
google::protobuf.internal::MapKeyDataOnlyByteSize
static size_t MapKeyDataOnlyByteSize(const FieldDescriptor *field, const MapKey &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1138
google::protobuf.internal::SerializeMapKeyWithCachedSizes
static uint8 * SerializeMapKeyWithCachedSizes(const FieldDescriptor *field, const MapKey &value, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:687
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf::Reflection::GetRepeatedStringReference
const std::string & GetRepeatedStringReference(const Message &message, const FieldDescriptor *field, int index, std::string *scratch) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1240
google::protobuf::Reflection::FindKnownExtensionByNumber
const FieldDescriptor * FindKnownExtensionByNumber(int number) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1818
google::protobuf.internal::MapKeySorter::MapKeyComparator
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:783
UnknownField
Definition: upb/upb/util/compare_test.cc:66
google::protobuf.internal::UnknownFieldParse
const char * UnknownFieldParse(uint32 tag, std::string *unknown, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:606
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:104
google::protobuf.internal::WireFormat::MessageSetParser::descriptor
const Descriptor * descriptor
Definition: protobuf/src/google/protobuf/wire_format.cc:784
google::protobuf.internal::WireFormat::ByteSize
static size_t ByteSize(const Message &message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1069
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::FieldDescriptor::TYPE_BYTES
@ TYPE_BYTES
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:538
google::protobuf::DynamicMapSorter::Sort
static std::vector< const Message * > Sort(const Message &message, int map_size, const Reflection *reflection, const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/dynamic_message.h:158
google::protobuf::FieldDescriptor::TYPE_DOUBLE
@ TYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:522
google::protobuf.internal::ParseContext
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:336
google::protobuf.internal::EpsCopyInputStream::EndedAtLimit
bool EndedAtLimit() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:188
google::protobuf::Reflection::MutableInternalMetadata
internal::InternalMetadata * MutableInternalMetadata(Message *message) const
Definition: protobuf/src/google/protobuf/generated_message_reflection.cc:2448
testing::internal::UInt64
TypeWithSize< 8 >::UInt UInt64
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2162
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf.internal::WireFormatLite::kMessageSetTypeIdNumber
static const int kMessageSetTypeIdNumber
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:213
google::protobuf.internal::ParseContext::data
Data & data()
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:356
google::protobuf::Reflection::AddInt32
void AddInt32(Message *message, const FieldDescriptor *field, int32 value) const
google::protobuf.internal::FromIntSize
size_t FromIntSize(int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:97
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
google::protobuf::Reflection::SetInt64
void SetInt64(Message *message, const FieldDescriptor *field, int64 value) const
google::protobuf::Reflection::GetRepeatedEnum
const EnumValueDescriptor * GetRepeatedEnum(const Message &message, const FieldDescriptor *field, int index) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1348
HANDLE_PRIMITIVE_TYPE
#define HANDLE_PRIMITIVE_TYPE(TYPE, CPPTYPE, TYPE_METHOD, CPPTYPE_METHOD)
google::protobuf.internal::UnknownFieldSetFieldSkipper::SkipMessage
bool SkipMessage(io::CodedInputStream *input) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:77
testing::internal::UInt32
TypeWithSize< 4 >::UInt UInt32
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2160
google::protobuf::FieldDescriptor::TYPE_GROUP
@ TYPE_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:535
google::protobuf::Reflection
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:397
google::protobuf.internal::WireFormatLite::InternalWriteMessage
static PROTOBUF_NDEBUG_INLINE uint8_t * InternalWriteMessage(int field_number, const MessageType &value, uint8_t *target, io::EpsCopyOutputStream *stream)
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
iterator
const typedef MCPhysReg * iterator
Definition: MCRegisterInfo.h:27
google::protobuf::Reflection::HasField
bool HasField(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:728
google::protobuf::HANDLE_TYPE
HANDLE_TYPE(int32, FieldDescriptor::CPPTYPE_INT32, -1)
google::protobuf.internal::WireFormat::ParseAndMergeField
static bool ParseAndMergeField(uint32 tag, const FieldDescriptor *field, Message *message, io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:417
google::protobuf::python::cmessage::UnknownFieldSet
static PyObject * UnknownFieldSet(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2512
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED64
@ WIRETYPE_FIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:103
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
google::protobuf.internal::WireFormat::InternalSerializeUnknownFieldsToArray
static uint8 * InternalSerializeUnknownFieldsToArray(const UnknownFieldSet &unknown_fields, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:192
BOOL
int BOOL
Definition: undname.c:46
Enum
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:867
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
google::protobuf.internal::WireFormatLite::MakeTag
constexpr static uint32 MakeTag(int field_number, WireType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:783
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf.internal::WireFormat::ComputeUnknownFieldsSize
static size_t ComputeUnknownFieldsSize(const UnknownFieldSet &unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:266
google::protobuf::FileDescriptor::SYNTAX_PROTO3
@ SYNTAX_PROTO3
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1394
google::protobuf.internal::WireFormatLite::kMessageSetItemEndTag
static const int kMessageSetItemEndTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:217
google::protobuf.internal::SerializeMapValueRefWithCachedSizes
static uint8 * SerializeMapValueRefWithCachedSizes(const FieldDescriptor *field, const MapValueRef &value, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:724
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::io::EpsCopyOutputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:651
google::protobuf::FieldDescriptor::TYPE_ENUM
@ TYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:540
google::protobuf.internal::MapKeySorter::MapKeyComparator::operator()
bool operator()(const MapKey &a, const MapKey &b) const
Definition: protobuf/src/google/protobuf/wire_format.cc:1170
google::protobuf::UnknownField::TYPE_FIXED32
@ TYPE_FIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:220
google::protobuf.internal::StrictUtf8Check
static bool StrictUtf8Check(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:413
google::protobuf::UnknownFieldSet::default_instance
static const UnknownFieldSet * default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.cc:53
google::protobuf.internal::WireFormatLite::WriteEnumToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteEnumToArray(int field_number, int value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1596
google::protobuf.internal::ParseBigVarint
const char * ParseBigVarint(const char *p, uint64 *out)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:536
google::protobuf.internal::WireFormatLite::InternalWriteGroup
static PROTOBUF_NDEBUG_INLINE uint8_t * InternalWriteGroup(int field_number, const MessageType &value, uint8_t *target, io::EpsCopyOutputStream *stream)
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
google::protobuf.internal::PackedEnumParser
const char * PackedEnumParser(void *object, const char *ptr, ParseContext *ctx)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:478
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
google::protobuf.internal::WireFormat::FieldByteSize
static size_t FieldByteSize(const FieldDescriptor *field, const Message &message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1101
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED32
@ WIRETYPE_FIXED32
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:107
google::protobuf.internal::WireFormatLite::SERIALIZE
@ SERIALIZE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:324
google::protobuf::Reflection::MutableUnknownFields
UnknownFieldSet * MutableUnknownFields(Message *message) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:237
google::protobuf::Reflection::AddEnum
void AddEnum(Message *message, const FieldDescriptor *field, const EnumValueDescriptor *value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1405
google::protobuf.internal::WireFormat::InternalSerializeMessageSetItem
static uint8 * InternalSerializeMessageSetItem(const FieldDescriptor *field, const Message &message, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1044
google::protobuf.internal::WireFormat::SkipMessageSetField
static bool SkipMessageSetField(io::CodedInputStream *input, uint32 field_number, UnknownFieldSet *unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:382
GOOGLE_PROTOBUF_PARSER_ASSERT
#define GOOGLE_PROTOBUF_PARSER_ASSERT(predicate)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:660
google::protobuf.internal::VarintParse
const PROTOBUF_MUST_USE_RESULT char * VarintParse(const char *p, T *out)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:471
testing::internal::Float
FloatingPoint< float > Float
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:396
google::protobuf.internal::WireFormatLite::PARSE
@ PARSE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:323
google::protobuf.internal::WriteLengthDelimited
void WriteLengthDelimited(uint32 num, StringPiece val, std::string *s)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.cc:334
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf.internal::WireFormatLite::ReadString
static bool ReadString(io::CodedInputStream *input, std::string *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:893
google::protobuf.internal::WireFormat::ComputeUnknownMessageSetItemsSize
static size_t ComputeUnknownMessageSetItemsSize(const UnknownFieldSet &unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:308
google::protobuf.internal::ParseMessageSetItemImpl
bool ParseMessageSetItemImpl(io::CodedInputStream *input, MS ms)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1808
google::protobuf::EnumValueDescriptor::number
int number() const
google::protobuf.internal::WireFormatLite::ReadMessage
static bool ReadMessage(io::CodedInputStream *input, MessageType *value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1275
grpc::protobuf::io::CodedInputStream
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:102
google::protobuf::io::CodedOutputStream::VarintSize32
static size_t VarintSize32(uint32 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1654
google::protobuf::UnknownFieldSet::AddVarint
void AddVarint(int number, uint64 value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.cc:135
google::protobuf.internal::WireFormatLite::LengthDelimitedSize
static size_t LengthDelimitedSize(size_t length)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1798
google::protobuf.internal::UnknownFieldSetFieldSkipper::SkipField
bool SkipField(io::CodedInputStream *input, uint32 tag) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:72
google::protobuf::Reflection::GetUnknownFields
const UnknownFieldSet & GetUnknownFields(const Message &message) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:232
google::protobuf.internal::InternalMetadata
Definition: protobuf/src/google/protobuf/metadata_lite.h:62
google::protobuf::Reflection::SetInt32
void SetInt32(Message *message, const FieldDescriptor *field, int32 value) const
google::protobuf::Reflection::AddEnumValue
void AddEnumValue(Message *message, const FieldDescriptor *field, int value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1412
google::protobuf::io::CodedOutputStream::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1650
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf.internal::WireFormat::MessageSetParser::reflection
const Reflection * reflection
Definition: protobuf/src/google/protobuf/wire_format.cc:785
EnumValueDescriptor
Definition: protobuf/php/ext/google/protobuf/def.c:63
google::protobuf.internal::UnknownFieldSetFieldSkipper::SkipUnknownEnum
void SkipUnknownEnum(int field_number, int value) override
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:81
google::protobuf::Reflection::GetEnum
const EnumValueDescriptor * GetEnum(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1293
google::protobuf::Reflection::MapBegin
MapIterator MapBegin(Message *message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1788
google::protobuf.internal::WireFormatLite::VerifyUtf8String
static bool VerifyUtf8String(const char *data, int size, Operation op, const char *field_name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.cc:584
google::protobuf.internal::WireFormatLite::WriteFixed64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64ToArray(int field_number, uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1566
google::protobuf::Reflection::SetString
void SetString(Message *message, const FieldDescriptor *field, std::string value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1193
google::protobuf.internal::InternalSerializeMapEntry
static uint8 * InternalSerializeMapEntry(const FieldDescriptor *field, const MapKey &key, const MapValueRef &value, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:808
google::protobuf.internal::WireFormatLite::kMessageSetItemStartTag
static const int kMessageSetItemStartTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:215
google::protobuf.internal::ParseContext::Data::factory
MessageFactory * factory
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:340
google::protobuf.internal::WireFormat::_InternalParseAndMergeField
static const char * _InternalParseAndMergeField(Message *msg, const char *ptr, internal::ParseContext *ctx, uint64_t tag, const Reflection *reflection, const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/wire_format.cc:827
google::protobuf.internal::WireFormatLite::WIRETYPE_VARINT
@ WIRETYPE_VARINT
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:102
google::protobuf.internal::WireFormat::_InternalSerialize
static uint8_t * _InternalSerialize(const Message &message, uint8_t *target, io::EpsCopyOutputStream *stream)
Definition: protobuf/src/google/protobuf/wire_format.cc:1043
google::protobuf::UnknownField::TYPE_VARINT
@ TYPE_VARINT
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:219
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
google::protobuf.internal::WireFormat::MessageSetParser::ParseMessageSet
const char * ParseMessageSet(const char *ptr, internal::ParseContext *ctx)
Definition: protobuf/src/google/protobuf/wire_format.cc:751
Fixed64
TypeAndValue Fixed64(uint64_t val)
Definition: upb/upb/util/compare_test.cc:83
google::protobuf.internal::MapValueRefDataOnlyByteSize
static size_t MapValueRefDataOnlyByteSize(const FieldDescriptor *field, const MapValueRef &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1179
google::protobuf::Reflection::FieldSize
int FieldSize(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:744
google::protobuf::ERROR
static const LogLevel ERROR
Definition: bloaty/third_party/protobuf/src/google/protobuf/testing/googletest.h:70
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
google::protobuf::UnknownField::TYPE_LENGTH_DELIMITED
@ TYPE_LENGTH_DELIMITED
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:222
google::protobuf::Reflection::MutableMessage
Message * MutableMessage(Message *message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1461
google::protobuf.internal::WireFormatLite::GetTagFieldNumber
static int GetTagFieldNumber(uint32 tag)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:792
google::protobuf.internal::WireFormat::ParseAndMergeMessageSetItem
static bool ParseAndMergeMessageSetItem(io::CodedInputStream *input, Message *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:635
google::protobuf::FieldDescriptor::TYPE_SINT32
@ TYPE_SINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:543
FATAL
#define FATAL(msg)
Definition: task.h:88
google::protobuf.internal::WireFormatLite::GetTagWireType
static WireType GetTagWireType(uint32 tag)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:788
google::protobuf.internal::WireFormatLite::kMessageSetMessageNumber
static const int kMessageSetMessageNumber
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:214
google::protobuf::UnknownField::TYPE_FIXED64
@ TYPE_FIXED64
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:221
google::protobuf.internal::WireFormatLite::StringSize
static size_t StringSize(const std::string &value)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1767
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
key
const char * key
Definition: hpack_parser_table.cc:164
google::protobuf.internal::WireFormatLite::WIRETYPE_START_GROUP
@ WIRETYPE_START_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:105
scratch
static char scratch[256]
Definition: test-random.c:27
google::protobuf::FieldDescriptor::TYPE_SINT64
@ TYPE_SINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:544
google::protobuf.internal::WireFormat::MessageSetParser::_InternalParse
const char * _InternalParse(const char *ptr, internal::ParseContext *ctx)
Definition: protobuf/src/google/protobuf/wire_format.cc:657
google::protobuf::FieldDescriptor::TYPE_FLOAT
@ TYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:523
google::protobuf.internal::ToCachedSize
int ToCachedSize(size_t size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message_lite.h:90
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
google::protobuf.internal::WireFormat::VerifyUTF8StringNamedField
static void VerifyUTF8StringNamedField(const char *data, int size, Operation op, const char *field_name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:353
google::protobuf.internal::CachedSize
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.h:170
HANDLE_PACKED_TYPE
#define HANDLE_PACKED_TYPE(TYPE, CPPTYPE, CPPTYPE_METHOD)
google::protobuf::Reflection::SetEnumValue
void SetEnumValue(Message *message, const FieldDescriptor *field, int value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1321
google::protobuf::MapKey
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:371
CASE_TYPE
#define CASE_TYPE(FieldType, CamelFieldType, CamelCppType)
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
google::protobuf.internal::WireFormat::WireTypeForFieldType
static WireFormatLite::WireType WireTypeForFieldType(FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:319
google::protobuf::UnknownFieldSet
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:81
testing::internal::Double
FloatingPoint< double > Double
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h:397
google::protobuf::io::CodedInputStream
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:180
values
std::array< int64_t, Size > values
Definition: abseil-cpp/absl/container/btree_benchmark.cc:608
google::protobuf.internal::WireFormat::InternalSerializeUnknownMessageSetItemsToArray
static uint8 * InternalSerializeUnknownMessageSetItemsToArray(const UnknownFieldSet &unknown_fields, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:230
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
google::protobuf.internal::CachedSize::Set
void Set(int size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.h:173
google::protobuf.internal::WireFormat::ParseAndMergePartial
static bool ParseAndMergePartial(io::CodedInputStream *input, Message *message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:331
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::FieldDescriptor::TYPE_MESSAGE
@ TYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:536
google::protobuf.internal::UnknownFieldSetFieldSkipper::unknown_fields_
UnknownFieldSet * unknown_fields_
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:305
google::protobuf::Reflection::AddInt64
void AddInt64(Message *message, const FieldDescriptor *field, int64 value) const
google::protobuf::Reflection::AddString
void AddString(Message *message, const FieldDescriptor *field, std::string value) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1274
make_dist_html.GROUP
string GROUP
Definition: make_dist_html.py:52
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf.internal::WireFormat::FieldDataOnlyByteSize
static size_t FieldDataOnlyByteSize(const FieldDescriptor *field, const Message &message)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1219
google::protobuf.internal::WireFormatLite::kMessageSetMessageTag
static const int kMessageSetMessageTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:221
google::protobuf.internal::WireFormatLite::WireType
WireType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:101
google::protobuf.internal::ReadVarintZigZag32
int32 ReadVarintZigZag32(const char **p)
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:590
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::io::CodedOutputStream::WriteVarint32ToArray
static uint8 * WriteVarint32ToArray(uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:1586
google::protobuf.internal::WireFormat::ParseAndMergeMessageSetField
static bool ParseAndMergeMessageSetField(uint32 field_number, const FieldDescriptor *field, Message *message, io::CodedInputStream *input)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:391
kMapEntryTagByteSize
const size_t kMapEntryTagByteSize
Definition: protobuf/src/google/protobuf/wire_format.cc:60
grpc::UNKNOWN
@ UNKNOWN
Definition: grpcpp/impl/codegen/status_code_enum.h:37
google::protobuf::Reflection::MutableRepeatedFieldInternal
RepeatedField< T > * MutableRepeatedFieldInternal(Message *message, const FieldDescriptor *field) const
google::protobuf.internal::WireFormatLite::WIRETYPE_END_GROUP
@ WIRETYPE_END_GROUP
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:106
internal
Definition: benchmark/test/output_test_helper.cc:20
google::protobuf.internal::WireFormat::MessageSetParser::msg
Message * msg
Definition: protobuf/src/google/protobuf/wire_format.cc:783
iter
Definition: test_winkernel.cpp:47
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
google::protobuf::io::CodedInputStream::Limit
int Limit
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream.h:348
testing::internal::Int64
TypeWithSize< 8 >::Int Int64
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2161
google::protobuf.internal::ComputeUnknownFieldsSize
size_t ComputeUnknownFieldsSize(const InternalMetadataWithArena &metadata, size_t total_size, CachedSize *cached_size)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:1350
google::protobuf.internal::WireFormatLite::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(int field_number, WireType type, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1373
google::protobuf::Reflection::GetMapData
const internal::MapFieldBase * GetMapData(const Message &message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:2219
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
Fixed32
TypeAndValue Fixed32(uint32_t val)
Definition: upb/upb/util/compare_test.cc:89
google::protobuf.internal::WireFormat::SERIALIZE
@ SERIALIZE
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.h:265
google::protobuf::Reflection::AddMessage
Message * AddMessage(Message *message, const FieldDescriptor *field, MessageFactory *factory=nullptr) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1637
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
length
std::size_t length
Definition: abseil-cpp/absl/time/internal/test_util.cc:57
google::protobuf::FieldDescriptor::TypeToCppType
static CppType TypeToCppType(Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:2147
google::protobuf::MapIterator
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:712
google::protobuf.internal::ParseContext::Data::pool
const DescriptorPool * pool
Definition: bloaty/third_party/protobuf/src/google/protobuf/parse_context.h:339
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf.internal::WireFormatLite::WriteFixed32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32ToArray(int field_number, uint32 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1561
google::protobuf.internal::WireFormatLite::WriteUInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64ToArray(int field_number, uint64 value, uint8 *target)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:1546
google::protobuf.internal::WireFormat::SkipMessage
static bool SkipMessage(io::CodedInputStream *input, UnknownFieldSet *unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:148
GOOGLE_LOG
#define GOOGLE_LOG(LEVEL)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:146
gen_server_registered_method_bad_client_test_body.payload
list payload
Definition: gen_server_registered_method_bad_client_test_body.py:40
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::Reflection::ListFields
void ListFields(const Message &message, std::vector< const FieldDescriptor * > *output) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1029
google::protobuf::FieldDescriptor::TYPE_STRING
@ TYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:534
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
google::protobuf.internal::WireFormatLite::kMessageSetItemTagsSize
static const size_t kMessageSetItemTagsSize
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:225
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf.internal::WireFormat::InternalSerializeField
static uint8 * InternalSerializeField(const FieldDescriptor *field, const Message &message, uint8 *target, io::EpsCopyOutputStream *stream)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:828
Message
Definition: protobuf/php/ext/google/protobuf/message.c:53
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf.internal::WireFormatLite::kMessageSetTypeIdTag
static const int kMessageSetTypeIdTag
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:219
google::protobuf::MapValueConstRef
Definition: protobuf/src/google/protobuf/map_field.h:685
google::protobuf::Reflection::LookupMapValue
bool LookupMapValue(const Message &message, const FieldDescriptor *field, const MapKey &key, MapValueConstRef *val) const
Definition: protobuf/src/google/protobuf/generated_message_reflection.cc:2333
google::protobuf.internal::MapKeySorter::SortKey
static std::vector< MapKey > SortKey(const Message &message, const Reflection *reflection, const FieldDescriptor *field)
Definition: protobuf/src/google/protobuf/wire_format.cc:1152
google::protobuf.internal::WireFormat::SkipField
static bool SkipField(io::CodedInputStream *input, uint32 tag, UnknownFieldSet *unknown_fields)
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format.cc:85
RepeatedField
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:403
google::protobuf::Reflection::MapEnd
MapIterator MapEnd(Message *message, const FieldDescriptor *field) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:1796
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:53