Move EagerParseLazyField* APIs to proto2 namespace

PiperOrigin-RevId: 613387033
pull/16075/head
Protobuf Team Bot 9 months ago committed by Copybara-Service
parent dc484c131e
commit 434b530c06
  1. 2
      src/google/protobuf/BUILD.bazel
  2. 33
      src/google/protobuf/internal_message_util.cc
  3. 25
      src/google/protobuf/internal_message_util.h
  4. 3
      src/google/protobuf/internal_message_util_unittest.cc
  5. 4
      src/google/protobuf/message.cc
  6. 2
      src/google/protobuf/message.h

@ -561,7 +561,6 @@ PROTOBUF_HEADERS = [
"generated_message_bases.h", "generated_message_bases.h",
"generated_message_reflection.h", "generated_message_reflection.h",
"generated_message_tctable_gen.h", "generated_message_tctable_gen.h",
"internal_message_util.h",
"map_entry.h", "map_entry.h",
"map_field.h", "map_field.h",
"map_field_inl.h", "map_field_inl.h",
@ -594,7 +593,6 @@ cc_library(
"generated_message_reflection.cc", "generated_message_reflection.cc",
"generated_message_tctable_full.cc", "generated_message_tctable_full.cc",
"generated_message_tctable_gen.cc", "generated_message_tctable_gen.cc",
"internal_message_util.cc",
"map_field.cc", "map_field.cc",
"message.cc", "message.cc",
"reflection_mode.cc", "reflection_mode.cc",

@ -1,33 +0,0 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "google/protobuf/internal_message_util.h"
#include <queue>
#include <vector>
#include "google/protobuf/descriptor.h"
#include "google/protobuf/map_field.h"
#include "google/protobuf/message.h"
#include "google/protobuf/port.h"
#include "google/protobuf/reflection_visit_fields.h"
// clang-format off
#include "google/protobuf/port_def.inc"
// clang-format on
namespace google {
namespace protobuf {
namespace internal {
} // namespace internal
} // namespace protobuf
} // namespace google
#include "google/protobuf/port_undef.inc"

@ -1,25 +0,0 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
//
// This file contains miscellaneous (non-lite) helper code not suitable to
// generated_message_util.h. This should not be used directly by users.
#ifndef GOOGLE_PROTOBUF_INTERNAL_MESSAGE_UTIL_H__
#define GOOGLE_PROTOBUF_INTERNAL_MESSAGE_UTIL_H__
#include "google/protobuf/message.h"
namespace google {
namespace protobuf {
namespace internal {
} // namespace internal
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_INTERNAL_MESSAGE_UTIL_H__

@ -5,8 +5,6 @@
// license that can be found in the LICENSE file or at // license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd // https://developers.google.com/open-source/licenses/bsd
#include "google/protobuf/internal_message_util.h"
#include <memory> #include <memory>
#include <queue> #include <queue>
#include <string> #include <string>
@ -17,6 +15,7 @@
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "google/protobuf/map_unittest.pb.h" #include "google/protobuf/map_unittest.pb.h"
#include "google/protobuf/message.h"
#include "google/protobuf/reflection_visit_fields.h" #include "google/protobuf/reflection_visit_fields.h"
#include "google/protobuf/unittest.pb.h" #include "google/protobuf/unittest.pb.h"
#include "google/protobuf/unittest_mset.pb.h" #include "google/protobuf/unittest_mset.pb.h"

@ -16,6 +16,7 @@
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <new> // IWYU pragma: keep for operator new(). #include <new> // IWYU pragma: keep for operator new().
#include <queue>
#include <string> #include <string>
#include <vector> #include <vector>
@ -43,6 +44,7 @@
#include "google/protobuf/port.h" #include "google/protobuf/port.h"
#include "google/protobuf/reflection_internal.h" #include "google/protobuf/reflection_internal.h"
#include "google/protobuf/reflection_ops.h" #include "google/protobuf/reflection_ops.h"
#include "google/protobuf/reflection_visit_fields.h"
#include "google/protobuf/unknown_field_set.h" #include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/wire_format.h" #include "google/protobuf/wire_format.h"
@ -501,9 +503,9 @@ template void InternalMetadata::DoSwap<UnknownFieldSet>(UnknownFieldSet* other);
template void InternalMetadata::DeleteOutOfLineHelper<UnknownFieldSet>(); template void InternalMetadata::DeleteOutOfLineHelper<UnknownFieldSet>();
template UnknownFieldSet* template UnknownFieldSet*
InternalMetadata::mutable_unknown_fields_slow<UnknownFieldSet>(); InternalMetadata::mutable_unknown_fields_slow<UnknownFieldSet>();
} // namespace internal } // namespace internal
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google

@ -1664,6 +1664,8 @@ MutableRepeatedFieldRef<T> Reflection::GetMutableRepeatedFieldRef(
Message* message, const FieldDescriptor* field) const { Message* message, const FieldDescriptor* field) const {
return MutableRepeatedFieldRef<T>(message, field); return MutableRepeatedFieldRef<T>(message, field);
} }
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google

Loading…
Cancel
Save