aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-18 08:54:35 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-18 08:54:35 -0700
commit2c990387c72c085e646adfdecf277066f22e9b30 (patch)
treef5356b46eda34168ea234ab7632406fede422574 /src/core
parentf87b9551c232fcc986ede271f496d3812c2b7b80 (diff)
reviewer feedback
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/channel/channelz.cc5
-rw-r--r--src/core/lib/channel/channelz_registry.cc1
-rw-r--r--src/core/lib/json/json.cc3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc
index df85b89ad0..9d6002ed8a 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 7ca3fc5836..738a56d7c6 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 6d359573f8..e78b73cefd 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;