diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index a955ec2589a..8bf5167286e 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -274,6 +274,9 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) == GRPC_CHTTP2_CLIENT_CONNECT_STRLEN); + t->abstract = new D1; + t->abstract->foo(); + t->base.vtable = get_vtable(); t->ep = ep; /* one ref is for destroy */ diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 60cc280c431..dab0bd830e1 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -237,12 +237,26 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; +class AbstractBase { + public: + AbstractBase() {} + virtual void foo() { gpr_log(GPR_ERROR, "base"); } +}; + +class D1 : public AbstractBase { + public: + D1() {} + void foo() override { gpr_log(GPR_ERROR, "derived"); } +}; + struct grpc_chttp2_transport { grpc_transport base; /* must be first */ gpr_refcount refs; grpc_endpoint* ep; char* peer_string; + AbstractBase* abstract; + grpc_combiner* combiner; /** write execution state of the transport */