6161#include " runtime/runtime_options.h"
6262#include " google/protobuf/arena.h"
6363#include " google/protobuf/descriptor.h"
64+ #include " google/protobuf/io/zero_copy_stream.h"
6465#include " google/protobuf/message.h"
6566#include " google/protobuf/message_lite.h"
6667
@@ -312,10 +313,10 @@ std::string LegacyListValue::DebugString() const {
312313absl::Status LegacyListValue::SerializeTo (
313314 absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
314315 absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
315- absl::Nonnull<absl::Cord *> value ) const {
316+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
316317 ABSL_DCHECK (descriptor_pool != nullptr );
317318 ABSL_DCHECK (message_factory != nullptr );
318- ABSL_DCHECK (value != nullptr );
319+ ABSL_DCHECK (output != nullptr );
319320
320321 const google::protobuf::Descriptor* descriptor =
321322 descriptor_pool->FindMessageTypeByName (" google.protobuf.ListValue" );
@@ -331,7 +332,7 @@ absl::Status LegacyListValue::SerializeTo(
331332 if (wrapped == nullptr ) {
332333 return absl::UnknownError (" failed to convert legacy map to JSON" );
333334 }
334- if (!wrapped->SerializePartialToCord (value )) {
335+ if (!wrapped->SerializePartialToZeroCopyStream (output )) {
335336 return absl::UnknownError (
336337 absl::StrCat (" failed to serialize message: " , wrapped->GetTypeName ()));
337338 }
@@ -487,10 +488,10 @@ std::string LegacyMapValue::DebugString() const {
487488absl::Status LegacyMapValue::SerializeTo (
488489 absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
489490 absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
490- absl::Nonnull<absl::Cord *> value ) const {
491+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
491492 ABSL_DCHECK (descriptor_pool != nullptr );
492493 ABSL_DCHECK (message_factory != nullptr );
493- ABSL_DCHECK (value != nullptr );
494+ ABSL_DCHECK (output != nullptr );
494495
495496 const google::protobuf::Descriptor* descriptor =
496497 descriptor_pool->FindMessageTypeByName (" google.protobuf.Struct" );
@@ -505,7 +506,7 @@ absl::Status LegacyMapValue::SerializeTo(
505506 if (wrapped == nullptr ) {
506507 return absl::UnknownError (" failed to convert legacy map to JSON" );
507508 }
508- if (!wrapped->SerializePartialToCord (value )) {
509+ if (!wrapped->SerializePartialToZeroCopyStream (output )) {
509510 return absl::UnknownError (
510511 absl::StrCat (" failed to serialize message: " , wrapped->GetTypeName ()));
511512 }
@@ -732,14 +733,15 @@ std::string LegacyStructValue::DebugString() const {
732733absl::Status LegacyStructValue::SerializeTo (
733734 absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
734735 absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
735- absl::Nonnull<absl::Cord *> value ) const {
736+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
736737 ABSL_DCHECK (descriptor_pool != nullptr );
737738 ABSL_DCHECK (message_factory != nullptr );
738- ABSL_DCHECK (value != nullptr );
739+ ABSL_DCHECK (output != nullptr );
739740
740741 auto message_wrapper = AsMessageWrapper (message_ptr_, legacy_type_info_);
741742 if (ABSL_PREDICT_TRUE (
742- message_wrapper.message_ptr ()->SerializePartialToCord (value))) {
743+ message_wrapper.message_ptr ()->SerializePartialToZeroCopyStream (
744+ output))) {
743745 return absl::OkStatus ();
744746 }
745747 return absl::UnknownError (" failed to serialize protocol buffer message" );
0 commit comments