diff options
author | ncteisen <ncteisen@gmail.com> | 2018-01-23 11:31:53 -0800 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2018-01-23 11:31:53 -0800 |
commit | 7042b519e8076c10b42ad216afe8f80ba7ffcccc (patch) | |
tree | b024d3bef2764f41dd03aea327940216e14e2086 /src/core/lib/surface/channel.cc | |
parent | 4e8bcb2ceeb1fb1f79bba0d1498745824c9d19ca (diff) |
Switch to using RefCounted
Diffstat (limited to 'src/core/lib/surface/channel.cc')
-rw-r--r-- | src/core/lib/surface/channel.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index fcc5fd4311..613a83cd01 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -34,6 +34,7 @@ #include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/memory.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/api_trace.h" @@ -64,7 +65,7 @@ struct grpc_channel { gpr_mu registered_call_mu; registered_call* registered_calls; - grpc_core::ManualConstructor<grpc_core::ChannelTracer> tracer; + grpc_core::RefCountedPtr<grpc_core::ChannelTracer> tracer; char* target; }; @@ -202,13 +203,14 @@ grpc_channel* grpc_channel_create_with_builder( const grpc_integer_options options = {10, 0, 100}; size_t max_nodes = (size_t)grpc_channel_arg_get_integer(&args->args[i], options); - channel->tracer.Init(max_nodes); + channel->tracer = + grpc_core::MakeRefCounted<grpc_core::ChannelTracer>(max_nodes); } } grpc_channel_args_destroy(args); channel->tracer->AddTrace(grpc_slice_from_static_string("Channel created"), - GRPC_ERROR_NONE, GRPC_CHANNEL_IDLE, nullptr); + GRPC_ERROR_NONE, GRPC_CHANNEL_IDLE); return channel; } |