Untangle `GenericTypeHandler` cross-references + more IWYU in repeated_ptr_field.*

* `GenericTypeHandler` used to be forward-declared in message_lite.h and unncessarily friended by `MessageLite`, which was its only use in that source. repeated_ptr_field.h relied on that forward declaration being there, and fully defined `GenericTypeHandler` below the first use.
* `StringPieceField` was forward-declared, and now IWYU'ed.

PiperOrigin-RevId: 672686570
pull/18085/head
Protobuf Team Bot 3 months ago committed by Copybara-Service
parent 04e801f969
commit 1892185aee
  1. 5
      src/google/protobuf/message_lite.h
  2. 4
      src/google/protobuf/repeated_ptr_field.h

@ -225,9 +225,6 @@ class WireFormatLite;
class WeakFieldMap;
class RustMapHelper;
template <typename Type>
class GenericTypeHandler; // defined in repeated_field.h
// We compute sizes as size_t but cache them as int. This function converts a
// computed size to a cached size. Since we don't proceed with serialization
// if the total size was > INT_MAX, it is not important what this function
@ -959,8 +956,6 @@ class PROTOBUF_EXPORT MessageLite {
template <typename Type>
friend class Arena::InternalHelper;
template <typename Type>
friend class internal::GenericTypeHandler;
friend auto internal::GetClassData(const MessageLite& msg);

@ -94,6 +94,10 @@ struct ArenaOffsetHelper {
static constexpr size_t value = offsetof(T, arena_);
};
// Defined further below.
template <typename Type>
class GenericTypeHandler;
// This is the common base class for RepeatedPtrFields. It deals only in void*
// pointers. Users should not use this interface directly.
//

Loading…
Cancel
Save