Skip to content

Commit cfc07df

Browse files
Open sourcing reflection_visit_fieds.
Note that VisitFields() is an internal API and only meant for internal protobuf usages. PiperOrigin-RevId: 611586588
1 parent 988194a commit cfc07df

File tree

6 files changed

+2338
-5
lines changed

6 files changed

+2338
-5
lines changed

src/google/protobuf/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ PROTOBUF_HEADERS = [
540540
"reflection_internal.h",
541541
"reflection_mode.h",
542542
"reflection_ops.h",
543+
"reflection_visit_fields.h",
544+
"reflection_visit_field_info.h",
543545
"service.h",
544546
"text_format.h",
545547
"unknown_field_set.h",

src/google/protobuf/generated_message_reflection.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,6 @@ bool Reflection::IsEagerlyVerifiedLazyField(
357357
schema_.IsEagerlyVerifiedLazyField(field));
358358
}
359359
360-
bool Reflection::IsInlined(const FieldDescriptor* field) const {
361-
return schema_.IsFieldInlined(field);
362-
}
363-
364360
size_t Reflection::SpaceUsedLong(const Message& message) const {
365361
// object_size_ already includes the in-memory representation of each field
366362
// in the message, so we only need to account for additional memory used by

src/google/protobuf/message.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,9 @@ class PROTOBUF_EXPORT Reflection final {
11961196

11971197
internal::InternalMetadata* MutableInternalMetadata(Message* message) const;
11981198

1199-
inline bool IsInlined(const FieldDescriptor* field) const;
1199+
inline bool IsInlined(const FieldDescriptor* field) const {
1200+
return schema_.IsFieldInlined(field);
1201+
}
12001202

12011203
bool HasBit(const Message& message, const FieldDescriptor* field) const;
12021204
void SetBit(Message* message, const FieldDescriptor* field) const;

0 commit comments

Comments
 (0)