From 7fa201c8e57a3f070219c50c598ed99bf4870df1 Mon Sep 17 00:00:00 2001 From: ctiller <10120821+ctiller@users.noreply.github.com> Date: Mon, 6 May 2024 16:50:59 +0000 Subject: [PATCH] Automated change: Fix sanity tests --- src/core/lib/channel/promise_based_filter.h | 92 ++++++++++----------- src/core/lib/transport/call_filters.h | 48 +++++------ 2 files changed, 68 insertions(+), 72 deletions(-) diff --git a/src/core/lib/channel/promise_based_filter.h b/src/core/lib/channel/promise_based_filter.h index c845c5b3cb8..12c74a04914 100644 --- a/src/core/lib/channel/promise_based_filter.h +++ b/src/core/lib/channel/promise_based_filter.h @@ -351,7 +351,7 @@ auto MapResult(const NoInterceptor*, Promise x, void*) { } template -auto MapResult(absl::Status (Derived::Call::* fn)(ServerMetadata&), Promise x, +auto MapResult(absl::Status (Derived::Call::*fn)(ServerMetadata&), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); return Map(std::move(x), [call_data](ServerMetadataHandle md) { @@ -362,7 +362,7 @@ auto MapResult(absl::Status (Derived::Call::* fn)(ServerMetadata&), Promise x, } template -auto MapResult(void (Derived::Call::* fn)(ServerMetadata&), Promise x, +auto MapResult(void (Derived::Call::*fn)(ServerMetadata&), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); return Map(std::move(x), [call_data](ServerMetadataHandle md) { @@ -372,7 +372,7 @@ auto MapResult(void (Derived::Call::* fn)(ServerMetadata&), Promise x, } template -auto MapResult(void (Derived::Call::* fn)(ServerMetadata&, Derived*), Promise x, +auto MapResult(void (Derived::Call::*fn)(ServerMetadata&, Derived*), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); return Map(std::move(x), [call_data](ServerMetadataHandle md) { @@ -494,7 +494,7 @@ auto RunCall(Interceptor interceptor, CallArgs call_args, template inline auto InterceptClientToServerMessageHandler( - void (Derived::Call::* fn)(const Message&), + void (Derived::Call::*fn)(const Message&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call_data](MessageHandle msg) -> absl::optional { @@ -505,7 +505,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - ServerMetadataHandle (Derived::Call::* fn)(const Message&), + ServerMetadataHandle (Derived::Call::*fn)(const Message&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call_data](MessageHandle msg) -> absl::optional { @@ -519,7 +519,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - ServerMetadataHandle (Derived::Call::* fn)(const Message&, Derived*), + ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call_data](MessageHandle msg) -> absl::optional { @@ -534,7 +534,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - MessageHandle (Derived::Call::* fn)(MessageHandle, Derived*), + MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call_data](MessageHandle msg) -> absl::optional { @@ -545,8 +545,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - absl::StatusOr (Derived::Call::* fn)(MessageHandle, - Derived*), + absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call_data](MessageHandle msg) -> absl::optional { @@ -570,7 +569,7 @@ inline void InterceptClientToServerMessage(HookFunction hook, template inline void InterceptClientToServerMessage(HookFunction hook, - void (Derived::Call::* half_close)(), + void (Derived::Call::*half_close)(), FilterCallData* call_data, const CallArgs& call_args) { call_args.client_to_server_messages->InterceptAndMapWithHalfClose( @@ -586,7 +585,7 @@ inline void InterceptClientToServerMessage(const NoInterceptor*, template inline auto InterceptClientToServerMessageHandler( - ServerMetadataHandle (Derived::Call::* fn)(const Message&), + ServerMetadataHandle (Derived::Call::*fn)(const Message&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return @@ -600,7 +599,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - void (Derived::Call::* fn)(const Message&), typename Derived::Call* call, + void (Derived::Call::*fn)(const Message&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); return [call](MessageHandle msg) -> absl::optional { @@ -611,7 +610,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - ServerMetadataHandle (Derived::Call::* fn)(const Message&, Derived*), + ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); @@ -626,7 +625,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - MessageHandle (Derived::Call::* fn)(MessageHandle, Derived*), + MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); @@ -637,8 +636,7 @@ inline auto InterceptClientToServerMessageHandler( template inline auto InterceptClientToServerMessageHandler( - absl::StatusOr (Derived::Call::* fn)(MessageHandle, - Derived*), + absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); @@ -665,7 +663,7 @@ inline void InterceptClientToServerMessage(HookFunction fn, template inline void InterceptClientToServerMessage(HookFunction fn, - void (Derived::Call::* half_close)(), + void (Derived::Call::*half_close)(), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { @@ -687,8 +685,8 @@ inline void InterceptClientInitialMetadata(const NoInterceptor*, void*, void*, template inline void InterceptClientInitialMetadata( - void (Derived::Call::* fn)(ClientMetadata& md), - typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { + void (Derived::Call::*fn)(ClientMetadata& md), typename Derived::Call* call, + Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); call_spine->client_initial_metadata().receiver.InterceptAndMap( [call](ClientMetadataHandle md) { @@ -699,7 +697,7 @@ inline void InterceptClientInitialMetadata( template inline void InterceptClientInitialMetadata( - void (Derived::Call::* fn)(ClientMetadata& md, Derived* channel), + void (Derived::Call::*fn)(ClientMetadata& md, Derived* channel), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); @@ -712,7 +710,7 @@ inline void InterceptClientInitialMetadata( template inline void InterceptClientInitialMetadata( - ServerMetadataHandle (Derived::Call::* fn)(ClientMetadata& md), + ServerMetadataHandle (Derived::Call::*fn)(ClientMetadata& md), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); call_spine->client_initial_metadata().receiver.InterceptAndMap( @@ -727,8 +725,8 @@ inline void InterceptClientInitialMetadata( template inline void InterceptClientInitialMetadata( - ServerMetadataHandle (Derived::Call::* fn)(ClientMetadata& md, - Derived* channel), + ServerMetadataHandle (Derived::Call::*fn)(ClientMetadata& md, + Derived* channel), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); @@ -744,7 +742,7 @@ inline void InterceptClientInitialMetadata( template inline void InterceptClientInitialMetadata( - absl::Status (Derived::Call::* fn)(ClientMetadata& md), + absl::Status (Derived::Call::*fn)(ClientMetadata& md), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); call_spine->client_initial_metadata().receiver.InterceptAndMap( @@ -760,7 +758,7 @@ inline void InterceptClientInitialMetadata( template inline void InterceptClientInitialMetadata( - absl::Status (Derived::Call::* fn)(ClientMetadata& md, Derived* channel), + absl::Status (Derived::Call::*fn)(ClientMetadata& md, Derived* channel), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientInitialMetadata); @@ -780,7 +778,7 @@ inline void InterceptClientInitialMetadata( template absl::void_t( std::declval>))> -InterceptClientInitialMetadata(Promise (Derived::Call::* promise_factory)( +InterceptClientInitialMetadata(Promise (Derived::Call::*promise_factory)( ClientMetadata& md, Derived* channel), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { @@ -806,7 +804,7 @@ inline void InterceptServerInitialMetadata(const NoInterceptor*, void*, template inline void InterceptServerInitialMetadata( - void (Derived::Call::* fn)(ServerMetadata&), + void (Derived::Call::*fn)(ServerMetadata&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_args.server_initial_metadata->InterceptAndMap( @@ -818,7 +816,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - absl::Status (Derived::Call::* fn)(ServerMetadata&), + absl::Status (Derived::Call::*fn)(ServerMetadata&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_args.server_initial_metadata->InterceptAndMap( @@ -835,7 +833,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - void (Derived::Call::* fn)(ServerMetadata&, Derived*), + void (Derived::Call::*fn)(ServerMetadata&, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_args.server_initial_metadata->InterceptAndMap( @@ -847,7 +845,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - absl::Status (Derived::Call::* fn)(ServerMetadata&, Derived*), + absl::Status (Derived::Call::*fn)(ServerMetadata&, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_args.server_initial_metadata->InterceptAndMap( @@ -868,7 +866,7 @@ inline void InterceptServerInitialMetadata(const NoInterceptor*, void*, void*, template inline void InterceptServerInitialMetadata( - void (Derived::Call::* fn)(ServerMetadata&), typename Derived::Call* call, + void (Derived::Call::*fn)(ServerMetadata&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_spine->server_initial_metadata().sender.InterceptAndMap( @@ -880,7 +878,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - absl::Status (Derived::Call::* fn)(ServerMetadata&), + absl::Status (Derived::Call::*fn)(ServerMetadata&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); call_spine->server_initial_metadata().sender.InterceptAndMap( @@ -896,7 +894,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - void (Derived::Call::* fn)(ServerMetadata&, Derived*), + void (Derived::Call::*fn)(ServerMetadata&, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); @@ -909,7 +907,7 @@ inline void InterceptServerInitialMetadata( template inline void InterceptServerInitialMetadata( - absl::Status (Derived::Call::* fn)(ServerMetadata&, Derived*), + absl::Status (Derived::Call::*fn)(ServerMetadata&, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerInitialMetadata); @@ -929,7 +927,7 @@ inline void InterceptServerToClientMessage(const NoInterceptor*, void*, template inline void InterceptServerToClientMessage( - void (Derived::Call::* fn)(const Message&), + void (Derived::Call::*fn)(const Message&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_args.server_to_client_messages->InterceptAndMap( @@ -941,7 +939,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - ServerMetadataHandle (Derived::Call::* fn)(const Message&), + ServerMetadataHandle (Derived::Call::*fn)(const Message&), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_args.server_to_client_messages->InterceptAndMap( @@ -956,7 +954,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - ServerMetadataHandle (Derived::Call::* fn)(const Message&, Derived*), + ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_args.server_to_client_messages->InterceptAndMap( @@ -972,7 +970,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - MessageHandle (Derived::Call::* fn)(MessageHandle, Derived*), + MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_args.server_to_client_messages->InterceptAndMap( @@ -984,8 +982,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - absl::StatusOr (Derived::Call::* fn)(MessageHandle, - Derived*), + absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), FilterCallData* call_data, const CallArgs& call_args) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_args.server_to_client_messages->InterceptAndMap( @@ -1004,7 +1001,7 @@ inline void InterceptServerToClientMessage(const NoInterceptor*, void*, void*, template inline void InterceptServerToClientMessage( - void (Derived::Call::* fn)(const Message&), typename Derived::Call* call, + void (Derived::Call::*fn)(const Message&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_spine->server_to_client_messages().sender.InterceptAndMap( @@ -1016,7 +1013,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - ServerMetadataHandle (Derived::Call::* fn)(const Message&), + ServerMetadataHandle (Derived::Call::*fn)(const Message&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); call_spine->server_to_client_messages().sender.InterceptAndMap( @@ -1030,7 +1027,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - ServerMetadataHandle (Derived::Call::* fn)(const Message&, Derived*), + ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); @@ -1046,7 +1043,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - MessageHandle (Derived::Call::* fn)(MessageHandle, Derived*), + MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); @@ -1058,8 +1055,7 @@ inline void InterceptServerToClientMessage( template inline void InterceptServerToClientMessage( - absl::StatusOr (Derived::Call::* fn)(MessageHandle, - Derived*), + absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnServerToClientMessage); @@ -1103,7 +1099,7 @@ inline void InterceptServerTrailingMetadata( inline void InterceptFinalize(const NoInterceptor*, void*, void*) {} template -inline void InterceptFinalize(void (Call::* fn)(const grpc_call_final_info*), +inline void InterceptFinalize(void (Call::*fn)(const grpc_call_final_info*), void*, Call* call) { DCHECK(fn == &Call::OnFinalize); GetContext()->Add( @@ -1114,7 +1110,7 @@ inline void InterceptFinalize(void (Call::* fn)(const grpc_call_final_info*), template inline void InterceptFinalize( - void (Derived::Call::* fn)(const grpc_call_final_info*, Derived*), + void (Derived::Call::*fn)(const grpc_call_final_info*, Derived*), Derived* channel, typename Derived::Call* call) { DCHECK(fn == &Derived::Call::OnFinalize); GetContext()->Add( diff --git a/src/core/lib/transport/call_filters.h b/src/core/lib/transport/call_filters.h index 1a8c971ee73..fd267fd1685 100644 --- a/src/core/lib/transport/call_filters.h +++ b/src/core/lib/transport/call_filters.h @@ -313,7 +313,7 @@ struct AddOpImpl { // void $INTERCEPTOR_NAME($VALUE_TYPE&) template + void (FilterType::Call::*impl)(typename T::element_type&)> struct AddOpImpl { static void Add(FilterType* channel_data, size_t call_offset, @@ -350,8 +350,8 @@ struct AddOpImpl + void (FilterType::Call::*impl)(typename T::element_type&, + FilterType*)> struct AddOpImpl< FilterType, T, void (FilterType::Call::*)(typename T::element_type&, FilterType*), impl> { @@ -391,7 +391,7 @@ struct AddOpImpl< // $VALUE_HANDLE $INTERCEPTOR_NAME($VALUE_HANDLE, FilterType*) template + T (FilterType::Call::*impl)(T, FilterType*)> struct AddOpImpl { static void Add(FilterType* channel_data, size_t call_offset, Layout>& to) { @@ -433,7 +433,7 @@ struct AddOpImpl { // absl::Status $INTERCEPTOR_NAME($VALUE_TYPE&) template + absl::Status (FilterType::Call::*impl)(typename T::element_type&)> struct AddOpImpl { @@ -478,7 +478,7 @@ struct AddOpImpl struct AddOpImpl< FilterType, T, @@ -506,8 +506,8 @@ struct AddOpImpl< // absl::Status $INTERCEPTOR_NAME($VALUE_TYPE&, FilterType*) template + absl::Status (FilterType::Call::*impl)(typename T::element_type&, + FilterType*)> struct AddOpImpl struct AddOpImpl $INTERCEPTOR_NAME($VALUE_HANDLE, FilterType*) template (FilterType::Call::* impl)(T, FilterType*)> + absl::StatusOr (FilterType::Call::*impl)(T, FilterType*)> struct AddOpImpl (FilterType::Call::*)(T, FilterType*), impl> { @@ -594,7 +594,7 @@ struct AddOpImpl struct AddOpImpl struct AddOpImpl struct AddOpImpl struct AddOpImpl + R (FilterType::Call::*impl)(typename T::element_type&)> struct AddOpImpl< FilterType, T, R (FilterType::Call::*)(typename T::element_type&), impl, absl::enable_if_t>::value>> { @@ -763,7 +763,7 @@ struct AddOpImpl< // PROMISE_RETURNING(absl::Status) $INTERCEPTOR_NAME($VALUE_TYPE&, FilterType*) template + R (FilterType::Call::*impl)(typename T::element_type&, FilterType*)> struct AddOpImpl< FilterType, T, R (FilterType::Call::*)(typename T::element_type&, FilterType*), impl, @@ -819,7 +819,7 @@ struct AddOpImpl< // PROMISE_RETURNING(absl::StatusOr<$VALUE_HANDLE>) // $INTERCEPTOR_NAME($VALUE_HANDLE, FilterType*) template + R (FilterType::Call::*impl)(T, FilterType*)> struct AddOpImpl, PromiseResult>::value>> { @@ -1043,7 +1043,7 @@ struct StackData { template void AddFinalizer(FilterType* channel_data, size_t call_offset, - void (FilterType::Call::* p)(const grpc_call_final_info*)) { + void (FilterType::Call::*p)(const grpc_call_final_info*)) { DCHECK(p == &FilterType::Call::OnFinalize); finalizers.push_back(Finalizer{ channel_data, @@ -1057,8 +1057,8 @@ struct StackData { template void AddFinalizer(FilterType* channel_data, size_t call_offset, - void (FilterType::Call::* p)(const grpc_call_final_info*, - FilterType*)) { + void (FilterType::Call::*p)(const grpc_call_final_info*, + FilterType*)) { DCHECK(p == &FilterType::Call::OnFinalize); finalizers.push_back(Finalizer{ channel_data, @@ -1479,10 +1479,10 @@ class CallFilters { std::string DebugString() const; private: - template >( - filters_detail::StackData::* layout_ptr)> + filters_detail::StackData::*layout_ptr)> class PipePromise { public: class Push { @@ -1649,7 +1649,7 @@ class CallFilters { }; template ( - filters_detail::StackData::* half_close_layout_ptr)> + filters_detail::StackData::*half_close_layout_ptr)> class PullMessage { public: explicit PullMessage(CallFilters* filters) : filters_(filters) {}