aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel/channelz.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/channel/channelz.h')
-rw-r--r--src/core/lib/channel/channelz.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
index 2d4c1a058a..863447a5a4 100644
--- a/src/core/lib/channel/channelz.h
+++ b/src/core/lib/channel/channelz.h
@@ -56,8 +56,8 @@ class Channel : public RefCounted<Channel> {
ChannelTrace* trace() { return trace_.get(); }
void set_channel_destroyed() {
- GPR_ASSERT(!channel_destroyed_);
- channel_destroyed_ = true;
+ GPR_ASSERT(channel_ != nullptr);
+ channel_ = nullptr;
}
intptr_t channel_uuid() { return channel_uuid_; }
@@ -66,17 +66,18 @@ class Channel : public RefCounted<Channel> {
// testing peer friend.
friend class testing::ChannelPeer;
- bool channel_destroyed_ = false;
+ // helper for getting connectivity state.
+ grpc_connectivity_state GetConnectivityState();
+
+ // Not owned. Will be set to nullptr when the channel is destroyed.
grpc_channel* channel_;
- const char* target_;
+ UniquePtr<char> target_;
gpr_atm calls_started_ = 0;
gpr_atm calls_succeeded_ = 0;
gpr_atm calls_failed_ = 0;
gpr_atm last_call_started_millis_;
- intptr_t channel_uuid_;
+ const intptr_t channel_uuid_;
ManualConstructor<ChannelTrace> trace_;
-
- grpc_connectivity_state GetConnectivityState();
};
} // namespace channelz