|
23 | 23 |
|
24 | 24 | #include "google/protobuf/any.pb.h" |
25 | 25 | #include "google/protobuf/duration.pb.h" |
| 26 | +#include "google/protobuf/field_mask.pb.h" |
26 | 27 | #include "google/protobuf/struct.pb.h" |
27 | 28 | #include "google/protobuf/timestamp.pb.h" |
28 | 29 | #include "google/protobuf/wrappers.pb.h" |
29 | 30 | #include "google/protobuf/descriptor.pb.h" |
30 | 31 | #include "absl/base/attributes.h" |
| 32 | +#include "absl/base/call_once.h" |
31 | 33 | #include "absl/base/no_destructor.h" |
32 | 34 | #include "absl/base/nullability.h" |
33 | 35 | #include "absl/base/optimization.h" |
@@ -1735,7 +1737,36 @@ absl::StatusOr<FieldMaskReflection> GetFieldMaskReflection( |
1735 | 1737 | return reflection; |
1736 | 1738 | } |
1737 | 1739 |
|
| 1740 | +namespace { |
| 1741 | + |
| 1742 | +ABSL_CONST_INIT absl::once_flag link_well_known_message_reflection; |
| 1743 | + |
| 1744 | +void LinkWellKnownMessageReflection() { |
| 1745 | + google::protobuf::LinkMessageReflection<google::protobuf::BoolValue>(); |
| 1746 | + google::protobuf::LinkMessageReflection<google::protobuf::Int32Value>(); |
| 1747 | + google::protobuf::LinkMessageReflection<google::protobuf::Int64Value>(); |
| 1748 | + google::protobuf::LinkMessageReflection<google::protobuf::UInt32Value>(); |
| 1749 | + google::protobuf::LinkMessageReflection<google::protobuf::UInt64Value>(); |
| 1750 | + google::protobuf::LinkMessageReflection<google::protobuf::FloatValue>(); |
| 1751 | + google::protobuf::LinkMessageReflection<google::protobuf::DoubleValue>(); |
| 1752 | + google::protobuf::LinkMessageReflection<google::protobuf::BytesValue>(); |
| 1753 | + google::protobuf::LinkMessageReflection<google::protobuf::StringValue>(); |
| 1754 | + google::protobuf::LinkMessageReflection<google::protobuf::Any>(); |
| 1755 | + google::protobuf::LinkMessageReflection<google::protobuf::Duration>(); |
| 1756 | + google::protobuf::LinkMessageReflection<google::protobuf::Timestamp>(); |
| 1757 | + google::protobuf::LinkMessageReflection<google::protobuf::Value>(); |
| 1758 | + google::protobuf::LinkMessageReflection<google::protobuf::ListValue>(); |
| 1759 | + google::protobuf::LinkMessageReflection<google::protobuf::Struct>(); |
| 1760 | + google::protobuf::LinkMessageReflection<google::protobuf::FieldMask>(); |
| 1761 | +} |
| 1762 | + |
| 1763 | +} // namespace |
| 1764 | + |
1738 | 1765 | absl::Status Reflection::Initialize(absl::Nonnull<const DescriptorPool*> pool) { |
| 1766 | + if (pool == DescriptorPool::generated_pool()) { |
| 1767 | + absl::call_once(link_well_known_message_reflection, |
| 1768 | + &LinkWellKnownMessageReflection); |
| 1769 | + } |
1739 | 1770 | CEL_RETURN_IF_ERROR(NullValue().Initialize(pool)); |
1740 | 1771 | CEL_RETURN_IF_ERROR(BoolValue().Initialize(pool)); |
1741 | 1772 | CEL_RETURN_IF_ERROR(Int32Value().Initialize(pool)); |
|
0 commit comments