@ -31,6 +31,7 @@
# include "absl/container/inlined_vector.h"
# include "absl/functional/function_ref.h"
# include "absl/log/check.h"
# include "absl/meta/type_traits.h"
# include "absl/status/status.h"
# include "absl/strings/string_view.h"
@ -352,7 +353,7 @@ auto MapResult(const NoInterceptor*, Promise x, void*) {
template < typename Promise , typename Derived >
auto MapResult ( absl : : Status ( Derived : : Call : : * fn ) ( ServerMetadata & ) , Promise x ,
FilterCallData < Derived > * call_data ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
return Map ( std : : move ( x ) , [ call_data ] ( ServerMetadataHandle md ) {
auto status = call_data - > call . OnServerTrailingMetadata ( * md ) ;
if ( ! status . ok ( ) ) return ServerMetadataFromStatus ( status ) ;
@ -363,7 +364,7 @@ auto MapResult(absl::Status (Derived::Call::*fn)(ServerMetadata&), Promise x,
template < typename Promise , typename Derived >
auto MapResult ( void ( Derived : : Call : : * fn ) ( ServerMetadata & ) , Promise x ,
FilterCallData < Derived > * call_data ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
return Map ( std : : move ( x ) , [ call_data ] ( ServerMetadataHandle md ) {
call_data - > call . OnServerTrailingMetadata ( * md ) ;
return md ;
@ -373,7 +374,7 @@ auto MapResult(void (Derived::Call::*fn)(ServerMetadata&), Promise x,
template < typename Promise , typename Derived >
auto MapResult ( void ( Derived : : Call : : * fn ) ( ServerMetadata & , Derived * ) , Promise x ,
FilterCallData < Derived > * call_data ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerTrailingMetadata ) ;
return Map ( std : : move ( x ) , [ call_data ] ( ServerMetadataHandle md ) {
call_data - > call . OnServerTrailingMetadata ( * md , call_data - > channel ) ;
return md ;
@ -486,7 +487,7 @@ template <typename Interceptor, typename Derived>
auto RunCall ( Interceptor interceptor , CallArgs call_args ,
NextPromiseFactory next_promise_factory ,
FilterCallData < Derived > * call_data ) {
GPR_DEBUG_ASSERT ( interceptor = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( interceptor = = & Derived : : Call : : OnClientInitialMetadata ) ;
return RunCallImpl < Interceptor , Derived > : : Run (
std : : move ( call_args ) , std : : move ( next_promise_factory ) , call_data ) ;
}
@ -498,7 +499,7 @@ template <typename Derived>
inline void InterceptClientToServerMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_args . client_to_server_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md = call_data - > call . OnClientToServerMessage ( * msg ) ;
@ -513,7 +514,7 @@ template <typename Derived>
inline void InterceptClientToServerMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_args . client_to_server_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md =
@ -529,7 +530,7 @@ template <typename Derived>
inline void InterceptClientToServerMessage (
MessageHandle ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_args . client_to_server_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
return call_data - > call . OnClientToServerMessage ( std : : move ( msg ) ,
@ -541,7 +542,7 @@ template <typename Derived>
inline void InterceptClientToServerMessage (
absl : : StatusOr < MessageHandle > ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_args . client_to_server_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto r = call_data - > call . OnClientToServerMessage ( std : : move ( msg ) ,
@ -560,7 +561,7 @@ template <typename Derived>
inline void InterceptClientToServerMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & ) ,
typename Derived : : Call * call , Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_spine - > client_to_server_messages ( ) . receiver . InterceptAndMap (
[ call , call_spine ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md = call - > OnClientToServerMessage ( * msg ) ;
@ -575,7 +576,7 @@ inline void InterceptClientToServerMessage(
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_spine - > client_to_server_messages ( ) . receiver . InterceptAndMap (
[ call , call_spine ,
channel ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
@ -591,7 +592,7 @@ inline void InterceptClientToServerMessage(
MessageHandle ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_spine - > client_to_server_messages ( ) . receiver . InterceptAndMap (
[ call , channel ] ( MessageHandle msg ) {
return call - > OnClientToServerMessage ( std : : move ( msg ) , channel ) ;
@ -603,7 +604,7 @@ inline void InterceptClientToServerMessage(
absl : : StatusOr < MessageHandle > ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientToServerMessage ) ;
call_spine - > client_to_server_messages ( ) . receiver . InterceptAndMap (
[ call , call_spine ,
channel ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
@ -622,7 +623,7 @@ template <typename Derived>
inline void InterceptClientInitialMetadata (
void ( Derived : : Call : : * fn ) ( ClientMetadata & md ) , typename Derived : : Call * call ,
Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call ] ( ClientMetadataHandle md ) {
call - > OnClientInitialMetadata ( * md ) ;
@ -635,7 +636,7 @@ inline void InterceptClientInitialMetadata(
void ( Derived : : Call : : * fn ) ( ClientMetadata & md , Derived * channel ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call , channel ] ( ClientMetadataHandle md ) {
call - > OnClientInitialMetadata ( * md , channel ) ;
@ -647,7 +648,7 @@ template <typename Derived>
inline void InterceptClientInitialMetadata (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( ClientMetadata & md ) ,
typename Derived : : Call * call , Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call_spine ,
call ] ( ClientMetadataHandle md ) - > absl : : optional < ClientMetadataHandle > {
@ -664,7 +665,7 @@ inline void InterceptClientInitialMetadata(
Derived * channel ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call_spine , call , channel ] (
ClientMetadataHandle md ) - > absl : : optional < ClientMetadataHandle > {
@ -679,7 +680,7 @@ template <typename Derived>
inline void InterceptClientInitialMetadata (
absl : : Status ( Derived : : Call : : * fn ) ( ClientMetadata & md ) ,
typename Derived : : Call * call , Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call_spine ,
call ] ( ClientMetadataHandle md ) - > absl : : optional < ClientMetadataHandle > {
@ -696,7 +697,7 @@ inline void InterceptClientInitialMetadata(
absl : : Status ( Derived : : Call : : * fn ) ( ClientMetadata & md , Derived * channel ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call_spine , call , channel ] (
ClientMetadataHandle md ) - > absl : : optional < ClientMetadataHandle > {
@ -717,7 +718,7 @@ InterceptClientInitialMetadata(Promise (Derived::Call::*promise_factory)(
ClientMetadata & md , Derived * channel ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( promise_factory = = & Derived : : Call : : OnClientInitialMetadata ) ;
DCHECK ( promise_factory = = & Derived : : Call : : OnClientInitialMetadata ) ;
call_spine - > client_initial_metadata ( ) . receiver . InterceptAndMap (
[ call , call_spine , channel ] ( ClientMetadataHandle md ) {
ClientMetadata & md_ref = * md ;
@ -741,7 +742,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
void ( Derived : : Call : : * fn ) ( ServerMetadata & ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_args . server_initial_metadata - > InterceptAndMap (
[ call_data ] ( ServerMetadataHandle md ) {
call_data - > call . OnServerInitialMetadata ( * md ) ;
@ -753,7 +754,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
absl : : Status ( Derived : : Call : : * fn ) ( ServerMetadata & ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_args . server_initial_metadata - > InterceptAndMap (
[ call_data ] (
ServerMetadataHandle md ) - > absl : : optional < ServerMetadataHandle > {
@ -770,7 +771,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
void ( Derived : : Call : : * fn ) ( ServerMetadata & , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_args . server_initial_metadata - > InterceptAndMap (
[ call_data ] ( ServerMetadataHandle md ) {
call_data - > call . OnServerInitialMetadata ( * md , call_data - > channel ) ;
@ -782,7 +783,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
absl : : Status ( Derived : : Call : : * fn ) ( ServerMetadata & , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_args . server_initial_metadata - > InterceptAndMap (
[ call_data ] (
ServerMetadataHandle md ) - > absl : : optional < ServerMetadataHandle > {
@ -803,7 +804,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
void ( Derived : : Call : : * fn ) ( ServerMetadata & ) , typename Derived : : Call * call ,
Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_spine - > server_initial_metadata ( ) . sender . InterceptAndMap (
[ call ] ( ServerMetadataHandle md ) {
call - > OnServerInitialMetadata ( * md ) ;
@ -815,7 +816,7 @@ template <typename Derived>
inline void InterceptServerInitialMetadata (
absl : : Status ( Derived : : Call : : * fn ) ( ServerMetadata & ) ,
typename Derived : : Call * call , Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_spine - > server_initial_metadata ( ) . sender . InterceptAndMap (
[ call , call_spine ] (
ServerMetadataHandle md ) - > absl : : optional < ServerMetadataHandle > {
@ -832,7 +833,7 @@ inline void InterceptServerInitialMetadata(
void ( Derived : : Call : : * fn ) ( ServerMetadata & , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_spine - > server_initial_metadata ( ) . sender . InterceptAndMap (
[ call , channel ] ( ServerMetadataHandle md ) {
call - > OnServerInitialMetadata ( * md , channel ) ;
@ -845,7 +846,7 @@ inline void InterceptServerInitialMetadata(
absl : : Status ( Derived : : Call : : * fn ) ( ServerMetadata & , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerInitialMetadata ) ;
call_spine - > server_initial_metadata ( ) . sender . InterceptAndMap (
[ call , call_spine , channel ] (
ServerMetadataHandle md ) - > absl : : optional < ServerMetadataHandle > {
@ -864,7 +865,7 @@ template <typename Derived>
inline void InterceptServerToClientMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_args . server_to_client_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md = call_data - > call . OnServerToClientMessage ( * msg ) ;
@ -879,7 +880,7 @@ template <typename Derived>
inline void InterceptServerToClientMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_args . server_to_client_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md =
@ -895,7 +896,7 @@ template <typename Derived>
inline void InterceptServerToClientMessage (
MessageHandle ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_args . server_to_client_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
return call_data - > call . OnServerToClientMessage ( std : : move ( msg ) ,
@ -907,7 +908,7 @@ template <typename Derived>
inline void InterceptServerToClientMessage (
absl : : StatusOr < MessageHandle > ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
FilterCallData < Derived > * call_data , const CallArgs & call_args ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_args . server_to_client_messages - > InterceptAndMap (
[ call_data ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto r = call_data - > call . OnServerToClientMessage ( std : : move ( msg ) ,
@ -926,7 +927,7 @@ template <typename Derived>
inline void InterceptServerToClientMessage (
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & ) ,
typename Derived : : Call * call , Derived * , PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_spine - > server_to_client_messages ( ) . sender . InterceptAndMap (
[ call , call_spine ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
auto return_md = call - > OnServerToClientMessage ( * msg ) ;
@ -941,7 +942,7 @@ inline void InterceptServerToClientMessage(
ServerMetadataHandle ( Derived : : Call : : * fn ) ( const Message & , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_spine - > server_to_client_messages ( ) . sender . InterceptAndMap (
[ call , call_spine ,
channel ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
@ -957,7 +958,7 @@ inline void InterceptServerToClientMessage(
MessageHandle ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_spine - > server_to_client_messages ( ) . sender . InterceptAndMap (
[ call , channel ] ( MessageHandle msg ) {
return call - > OnServerToClientMessage ( std : : move ( msg ) , channel ) ;
@ -969,7 +970,7 @@ inline void InterceptServerToClientMessage(
absl : : StatusOr < MessageHandle > ( Derived : : Call : : * fn ) ( MessageHandle , Derived * ) ,
typename Derived : : Call * call , Derived * channel ,
PipeBasedCallSpine * call_spine ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
DCHECK ( fn = = & Derived : : Call : : OnServerToClientMessage ) ;
call_spine - > server_to_client_messages ( ) . sender . InterceptAndMap (
[ call , call_spine ,
channel ] ( MessageHandle msg ) - > absl : : optional < MessageHandle > {
@ -1012,7 +1013,7 @@ inline void InterceptFinalize(const NoInterceptor*, void*, void*) {}
template < class Call >
inline void InterceptFinalize ( void ( Call : : * fn ) ( const grpc_call_final_info * ) ,
void * , Call * call ) {
GPR_DEBUG_ASSERT ( fn = = & Call : : OnFinalize ) ;
DCHECK ( fn = = & Call : : OnFinalize ) ;
GetContext < CallFinalization > ( ) - > Add (
[ call ] ( const grpc_call_final_info * final_info ) {
call - > OnFinalize ( final_info ) ;
@ -1023,7 +1024,7 @@ template <class Derived>
inline void InterceptFinalize (
void ( Derived : : Call : : * fn ) ( const grpc_call_final_info * , Derived * ) ,
Derived * channel , typename Derived : : Call * call ) {
GPR_DEBUG_ASSERT ( fn = = & Derived : : Call : : OnFinalize ) ;
DCHECK ( fn = = & Derived : : Call : : OnFinalize ) ;
GetContext < CallFinalization > ( ) - > Add (
[ call , channel ] ( const grpc_call_final_info * final_info ) {
call - > OnFinalize ( final_info , channel ) ;
@ -1212,8 +1213,7 @@ class BaseCallData : public Activity, private Wakeable {
~ BaseCallData ( ) override ;
void set_pollent ( grpc_polling_entity * pollent ) {
GPR_ASSERT ( nullptr = =
pollent_ . exchange ( pollent , std : : memory_order_release ) ) ;
CHECK ( nullptr = = pollent_ . exchange ( pollent , std : : memory_order_release ) ) ;
}
// Activity implementation (partial).
@ -1259,7 +1259,7 @@ class BaseCallData : public Activity, private Wakeable {
~ Flusher ( ) ;
void Resume ( grpc_transport_stream_op_batch * batch ) {
GPR_ASSERT ( ! call_ - > is_last ( ) ) ;
CHECK ( ! call_ - > is_last ( ) ) ;
if ( batch - > HasOp ( ) ) {
release_ . push_back ( batch ) ;
} else if ( batch - > on_complete ! = nullptr ) {
@ -1338,7 +1338,7 @@ class BaseCallData : public Activity, private Wakeable {
PipeSender < MessageHandle > * original_sender ( ) override { abort ( ) ; }
void GotPipe ( PipeReceiver < MessageHandle > * receiver ) override {
GPR_ASSERT ( receiver_ = = nullptr ) ;
CHECK_EQ ( receiver_ , nullptr ) ;
receiver_ = receiver ;
}
@ -1346,7 +1346,7 @@ class BaseCallData : public Activity, private Wakeable {
PipeSender < MessageHandle > * Push ( ) override { return & pipe_ . sender ; }
PipeReceiver < MessageHandle > * Pull ( ) override {
GPR_ASSERT ( receiver_ ! = nullptr ) ;
CHECK_NE ( receiver_ , nullptr ) ;
return receiver_ ;
}
@ -1367,12 +1367,12 @@ class BaseCallData : public Activity, private Wakeable {
void GotPipe ( PipeReceiver < MessageHandle > * ) override { abort ( ) ; }
void GotPipe ( PipeSender < MessageHandle > * sender ) override {
GPR_ASSERT ( sender_ = = nullptr ) ;
CHECK_EQ ( sender_ , nullptr ) ;
sender_ = sender ;
}
PipeSender < MessageHandle > * Push ( ) override {
GPR_ASSERT ( sender_ ! = nullptr ) ;
CHECK_NE ( sender_ , nullptr ) ;
return sender_ ;
}
PipeReceiver < MessageHandle > * Pull ( ) override { return & pipe_ . receiver ; }
@ -1890,7 +1890,7 @@ struct CallDataFilterWithFlagsMethods {
if ( ( kFlags & kFilterIsLast ) ! = 0 ) {
ExecCtx : : Run ( DEBUG_LOCATION , then_schedule_closure , absl : : OkStatus ( ) ) ;
} else {
GPR_ASSERT ( then_schedule_closure = = nullptr ) ;
CHECK_EQ ( then_schedule_closure , nullptr ) ;
}
}
} ;
@ -1927,7 +1927,7 @@ template <typename F, uint8_t kFlags>
struct ChannelFilterWithFlagsMethods {
static absl : : Status InitChannelElem ( grpc_channel_element * elem ,
grpc_channel_element_args * args ) {
GPR_ASSERT ( args - > is_last = = ( ( kFlags & kFilterIsLast ) ! = 0 ) ) ;
CHECK ( args - > is_last = = ( ( kFlags & kFilterIsLast ) ! = 0 ) ) ;
auto status = F : : Create ( args - > channel_args ,
ChannelFilter : : Args ( args - > channel_stack , elem ) ) ;
if ( ! status . ok ( ) ) {