diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-03-19 12:47:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 12:47:43 -0700 |
commit | 9bef1390540e7662b6d941c0a17f136b10ffc084 (patch) | |
tree | 2b3e2837fe2d97b8ce5e8a6a2401c74456fe980b /src/core/lib/json | |
parent | bce37d2785d508983f9d0501f6d711ef55ffc124 (diff) | |
parent | f2bea3725f8218777268decfd37c7b543f839d9f (diff) |
Merge pull request #14746 from grpc/revert-13883-channel-tracing
Revert "Channel Tracing Implementation; Part 1"
Diffstat (limited to 'src/core/lib/json')
-rw-r--r-- | src/core/lib/json/json.cc | 36 | ||||
-rw-r--r-- | src/core/lib/json/json.h | 21 |
2 files changed, 1 insertions, 56 deletions
diff --git a/src/core/lib/json/json.cc b/src/core/lib/json/json.cc index 816241bbf0..2141db4c5b 100644 --- a/src/core/lib/json/json.cc +++ b/src/core/lib/json/json.cc @@ -21,7 +21,6 @@ #include <string.h> #include <grpc/support/alloc.h> -#include <grpc/support/log.h> #include "src/core/lib/json/json.h" @@ -47,40 +46,5 @@ void grpc_json_destroy(grpc_json* json) { json->parent->child = json->next; } - if (json->owns_value) { - gpr_free((void*)json->value); - } - gpr_free(json); } - -grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child, - grpc_json* sibling) { - // first child case. - if (parent->child == nullptr) { - GPR_ASSERT(sibling == nullptr); - parent->child = child; - return child; - } - if (sibling == nullptr) { - sibling = parent->child; - } - // always find the right most sibling. - while (sibling->next != nullptr) { - sibling = sibling->next; - } - sibling->next = child; - return child; -} - -grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent, - const char* key, const char* value, - grpc_json_type type, bool owns_value) { - 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; -} diff --git a/src/core/lib/json/json.h b/src/core/lib/json/json.h index f93b43048b..3a62ef9cfb 100644 --- a/src/core/lib/json/json.h +++ b/src/core/lib/json/json.h @@ -21,7 +21,6 @@ #include <grpc/support/port_platform.h> -#include <stdbool.h> #include <stdlib.h> #include "src/core/lib/json/json_common.h" @@ -38,9 +37,6 @@ typedef struct grpc_json { grpc_json_type type; const char* key; const char* value; - - /* if set, destructor will free value */ - bool owns_value; } grpc_json; /* The next two functions are going to parse the input string, and @@ -71,24 +67,9 @@ char* grpc_json_dump_to_string(grpc_json* json, int indent); /* Use these to create or delete a grpc_json object. * Deletion is recursive. We will not attempt to free any of the strings - * in any of the objects of that tree, unless the boolean, owns_value, - * is true. + * in any of the objects of that tree. */ grpc_json* grpc_json_create(grpc_json_type type); void grpc_json_destroy(grpc_json* json); -/* Links the child json object into the parent's json tree. If the parent - * already has children, then passing in the most recently added child as the - * sibling parameter is an optimization. For if sibling is NULL, this function - * will manually traverse the tree in order to find the right most sibling. - */ -grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child, - grpc_json* sibling); - -/* Creates a child json object into the parent's json tree then links it in - * as described above. */ -grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent, - const char* key, const char* value, - grpc_json_type type, bool owns_value); - #endif /* GRPC_CORE_LIB_JSON_JSON_H */ |