reviewer feedback

reviewable/pr16020/r4
ncteisen 6 years ago
parent f87b9551c2
commit 2c990387c7
  1. 5
      src/core/lib/channel/channelz.cc
  2. 1
      src/core/lib/channel/channelz_registry.cc
  3. 3
      src/core/lib/json/json.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;

@ -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

@ -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;

Loading…
Cancel
Save