From 2c990387c72c085e646adfdecf277066f22e9b30 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 18 Jul 2018 08:54:35 -0700 Subject: [PATCH] reviewer feedback --- src/core/lib/channel/channelz.cc | 5 +---- src/core/lib/channel/channelz_registry.cc | 1 - src/core/lib/json/json.cc | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc index df85b89ad0c..9d6002ed8a1 100644 --- a/src/core/lib/channel/channelz.cc +++ b/src/core/lib/channel/channelz.cc @@ -98,11 +98,8 @@ grpc_json* ChannelNode::RenderJson() { if (trace != nullptr) { // we manually link up and fill the child since it was created for us in // ChannelTrace::RenderJson + trace->key = "trace"; // this object is named trace in channelz.proto json_iterator = grpc_json_link_child(json, trace, json_iterator); - trace->parent = json; - trace->value = nullptr; - trace->key = "trace"; - trace->owns_value = false; } // reset the parent to be the data object. json = data; diff --git a/src/core/lib/channel/channelz_registry.cc b/src/core/lib/channel/channelz_registry.cc index 7ca3fc58368..738a56d7c6b 100644 --- a/src/core/lib/channel/channelz_registry.cc +++ b/src/core/lib/channel/channelz_registry.cc @@ -107,7 +107,6 @@ char* ChannelzRegistry::InternalGetTopChannels(intptr_t start_channel_id) { grpc_json* channel_json = top_level_channels[i]->RenderJson(); json_iterator = grpc_json_link_child(array_parent, channel_json, json_iterator); - channel_json->parent = array_parent; } } // For now we do not have any pagination rules. In the future we could diff --git a/src/core/lib/json/json.cc b/src/core/lib/json/json.cc index 6d359573f86..e78b73cefd3 100644 --- a/src/core/lib/json/json.cc +++ b/src/core/lib/json/json.cc @@ -58,6 +58,8 @@ void grpc_json_destroy(grpc_json* json) { grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child, grpc_json* sibling) { + // link child up to parent + child->parent = parent; // first child case. if (parent->child == nullptr) { GPR_ASSERT(sibling == nullptr); @@ -81,7 +83,6 @@ grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent, grpc_json* child = grpc_json_create(type); grpc_json_link_child(parent, child, sibling); child->owns_value = owns_value; - child->parent = parent; child->value = value; child->key = key; return child;