aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/json
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@gmail.com>2018-03-19 12:05:18 -0700
committerGravatar GitHub <noreply@github.com>2018-03-19 12:05:18 -0700
commitf2bea3725f8218777268decfd37c7b543f839d9f (patch)
treed2d56cf0a2c35d12b3548b9bb0389961df47a923 /src/core/lib/json
parent373866da41cf86ec23fa3420b08a3d0a55151b58 (diff)
Revert "Channel Tracing Implementation; Part 1"
Diffstat (limited to 'src/core/lib/json')
-rw-r--r--src/core/lib/json/json.cc36
-rw-r--r--src/core/lib/json/json.h21
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 */