From 3422d7e5b3880a98d72cbe2b48bb3371c2908500 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 23 Jan 2023 13:02:57 -0800 Subject: [PATCH] SubchannelInterface: use DualRefCounted<> (#32181) * SubchannelInterface: use DualRefCounted<> * Automated change: Fix sanity tests Co-authored-by: markdroth --- src/core/BUILD | 2 +- src/core/lib/load_balancing/subchannel_interface.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index 2fecb3c706c..17358663ce6 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2490,8 +2490,8 @@ grpc_cc_library( hdrs = ["lib/load_balancing/subchannel_interface.h"], external_deps = ["absl/status"], deps = [ + "dual_ref_counted", "iomgr_fwd", - "ref_counted", "//:event_engine_base_hdrs", "//:gpr_platform", "//:ref_counted_ptr", diff --git a/src/core/lib/load_balancing/subchannel_interface.h b/src/core/lib/load_balancing/subchannel_interface.h index 5a8a6d36560..fea852690bd 100644 --- a/src/core/lib/load_balancing/subchannel_interface.h +++ b/src/core/lib/load_balancing/subchannel_interface.h @@ -26,14 +26,14 @@ #include -#include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/iomgr_fwd.h" namespace grpc_core { // The interface for subchannels that is exposed to LB policy implementations. -class SubchannelInterface : public RefCounted { +class SubchannelInterface : public DualRefCounted { public: class ConnectivityStateWatcherInterface { public: @@ -59,10 +59,12 @@ class SubchannelInterface : public RefCounted { }; explicit SubchannelInterface(const char* trace = nullptr) - : RefCounted(trace) {} + : DualRefCounted(trace) {} ~SubchannelInterface() override = default; + void Orphan() override {} + // Starts watching the subchannel's connectivity state. // The first callback to the watcher will be delivered ~immediately. // Subsequent callbacks will be delivered as the subchannel's state