61
61
#include " runtime/runtime_options.h"
62
62
#include " google/protobuf/arena.h"
63
63
#include " google/protobuf/descriptor.h"
64
+ #include " google/protobuf/io/zero_copy_stream.h"
64
65
#include " google/protobuf/message.h"
65
66
#include " google/protobuf/message_lite.h"
66
67
@@ -312,10 +313,10 @@ std::string LegacyListValue::DebugString() const {
312
313
absl::Status LegacyListValue::SerializeTo (
313
314
absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
314
315
absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
315
- absl::Nonnull<absl::Cord *> value ) const {
316
+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
316
317
ABSL_DCHECK (descriptor_pool != nullptr );
317
318
ABSL_DCHECK (message_factory != nullptr );
318
- ABSL_DCHECK (value != nullptr );
319
+ ABSL_DCHECK (output != nullptr );
319
320
320
321
const google::protobuf::Descriptor* descriptor =
321
322
descriptor_pool->FindMessageTypeByName (" google.protobuf.ListValue" );
@@ -331,7 +332,7 @@ absl::Status LegacyListValue::SerializeTo(
331
332
if (wrapped == nullptr ) {
332
333
return absl::UnknownError (" failed to convert legacy map to JSON" );
333
334
}
334
- if (!wrapped->SerializePartialToCord (value )) {
335
+ if (!wrapped->SerializePartialToZeroCopyStream (output )) {
335
336
return absl::UnknownError (
336
337
absl::StrCat (" failed to serialize message: " , wrapped->GetTypeName ()));
337
338
}
@@ -487,10 +488,10 @@ std::string LegacyMapValue::DebugString() const {
487
488
absl::Status LegacyMapValue::SerializeTo (
488
489
absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
489
490
absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
490
- absl::Nonnull<absl::Cord *> value ) const {
491
+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
491
492
ABSL_DCHECK (descriptor_pool != nullptr );
492
493
ABSL_DCHECK (message_factory != nullptr );
493
- ABSL_DCHECK (value != nullptr );
494
+ ABSL_DCHECK (output != nullptr );
494
495
495
496
const google::protobuf::Descriptor* descriptor =
496
497
descriptor_pool->FindMessageTypeByName (" google.protobuf.Struct" );
@@ -505,7 +506,7 @@ absl::Status LegacyMapValue::SerializeTo(
505
506
if (wrapped == nullptr ) {
506
507
return absl::UnknownError (" failed to convert legacy map to JSON" );
507
508
}
508
- if (!wrapped->SerializePartialToCord (value )) {
509
+ if (!wrapped->SerializePartialToZeroCopyStream (output )) {
509
510
return absl::UnknownError (
510
511
absl::StrCat (" failed to serialize message: " , wrapped->GetTypeName ()));
511
512
}
@@ -732,14 +733,15 @@ std::string LegacyStructValue::DebugString() const {
732
733
absl::Status LegacyStructValue::SerializeTo (
733
734
absl::Nonnull<const google::protobuf::DescriptorPool*> descriptor_pool,
734
735
absl::Nonnull<google::protobuf::MessageFactory*> message_factory,
735
- absl::Nonnull<absl::Cord *> value ) const {
736
+ absl::Nonnull<google::protobuf::io::ZeroCopyOutputStream *> output ) const {
736
737
ABSL_DCHECK (descriptor_pool != nullptr );
737
738
ABSL_DCHECK (message_factory != nullptr );
738
- ABSL_DCHECK (value != nullptr );
739
+ ABSL_DCHECK (output != nullptr );
739
740
740
741
auto message_wrapper = AsMessageWrapper (message_ptr_, legacy_type_info_);
741
742
if (ABSL_PREDICT_TRUE (
742
- message_wrapper.message_ptr ()->SerializePartialToCord (value))) {
743
+ message_wrapper.message_ptr ()->SerializePartialToZeroCopyStream (
744
+ output))) {
743
745
return absl::OkStatus ();
744
746
}
745
747
return absl::UnknownError (" failed to serialize protocol buffer message" );
0 commit comments