Skip to content

Commit

Permalink
Remove vtables from JSON library
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Dec 4, 2019
1 parent 45da08f commit 68df397
Show file tree
Hide file tree
Showing 30 changed files with 328 additions and 2,135 deletions.
4 changes: 0 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ grpc_cc_library(
"src/core/lib/iomgr/wakeup_fd_posix.cc",
"src/core/lib/json/json.cc",
"src/core/lib/json/json_reader.cc",
"src/core/lib/json/json_string.cc",
"src/core/lib/json/json_writer.cc",
"src/core/lib/slice/b64.cc",
"src/core/lib/slice/percent_encoding.cc",
Expand Down Expand Up @@ -918,9 +917,6 @@ grpc_cc_library(
"src/core/lib/iomgr/wakeup_fd_pipe.h",
"src/core/lib/iomgr/wakeup_fd_posix.h",
"src/core/lib/json/json.h",
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
"src/core/lib/slice/b64.h",
"src/core/lib/slice/percent_encoding.h",
"src/core/lib/slice/slice_hash_table.h",
Expand Down
8 changes: 0 additions & 8 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,8 @@ config("grpc_config") {
"src/core/lib/iomgr/wakeup_fd_posix.h",
"src/core/lib/json/json.cc",
"src/core/lib/json/json.h",
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.cc",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_string.cc",
"src/core/lib/json/json_writer.cc",
"src/core/lib/json/json_writer.h",
"src/core/lib/security/context/security_context.cc",
"src/core/lib/security/context/security_context.h",
"src/core/lib/security/credentials/alts/alts_credentials.cc",
Expand Down Expand Up @@ -1528,12 +1524,8 @@ config("grpc_config") {
"src/core/lib/iomgr/wakeup_fd_posix.h",
"src/core/lib/json/json.cc",
"src/core/lib/json/json.h",
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.cc",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_string.cc",
"src/core/lib/json/json_writer.cc",
"src/core/lib/json/json_writer.h",
"src/core/lib/profiling/timers.h",
"src/core/lib/slice/b64.cc",
"src/core/lib/slice/b64.h",
Expand Down
91 changes: 0 additions & 91 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c init_test)
add_dependencies(buildtests_c inproc_callback_test)
add_dependencies(buildtests_c invalid_call_argument_test)
add_dependencies(buildtests_c json_rewrite)
add_dependencies(buildtests_c json_rewrite_test)
add_dependencies(buildtests_c json_stream_error_test)
add_dependencies(buildtests_c json_test)
add_dependencies(buildtests_c lame_client_test)
add_dependencies(buildtests_c load_file_test)
Expand Down Expand Up @@ -1222,7 +1219,6 @@ add_library(grpc
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -1695,7 +1691,6 @@ add_library(grpc_cronet
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -2124,7 +2119,6 @@ add_library(grpc_test_util
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -2467,7 +2461,6 @@ add_library(grpc_test_util_unsecure
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -2786,7 +2779,6 @@ add_library(grpc_unsecure
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -3442,7 +3434,6 @@ add_library(grpc++
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -4707,7 +4698,6 @@ add_library(grpc++_unsecure
src/core/lib/iomgr/wakeup_fd_posix.cc
src/core/lib/json/json.cc
src/core/lib/json/json_reader.cc
src/core/lib/json/json_string.cc
src/core/lib/json/json_writer.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
Expand Down Expand Up @@ -8462,87 +8452,6 @@ target_link_libraries(invalid_call_argument_test
)


endif()
if(gRPC_BUILD_TESTS)

add_executable(json_rewrite
test/core/json/json_rewrite.cc
)

target_include_directories(json_rewrite
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
)

target_link_libraries(json_rewrite
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
)


endif()
if(gRPC_BUILD_TESTS)

add_executable(json_rewrite_test
test/core/json/json_rewrite_test.cc
)

target_include_directories(json_rewrite_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
)

target_link_libraries(json_rewrite_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
)


endif()
if(gRPC_BUILD_TESTS)

add_executable(json_stream_error_test
test/core/json/json_stream_error_test.cc
)

target_include_directories(json_stream_error_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
)

target_link_libraries(json_stream_error_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr
)


endif()
if(gRPC_BUILD_TESTS)

Expand Down
113 changes: 0 additions & 113 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1094,9 +1094,6 @@ init_test: $(BINDIR)/$(CONFIG)/init_test
inproc_callback_test: $(BINDIR)/$(CONFIG)/inproc_callback_test
invalid_call_argument_test: $(BINDIR)/$(CONFIG)/invalid_call_argument_test
json_fuzzer_test: $(BINDIR)/$(CONFIG)/json_fuzzer_test
json_rewrite: $(BINDIR)/$(CONFIG)/json_rewrite
json_rewrite_test: $(BINDIR)/$(CONFIG)/json_rewrite_test
json_stream_error_test: $(BINDIR)/$(CONFIG)/json_stream_error_test
json_test: $(BINDIR)/$(CONFIG)/json_test
lame_client_test: $(BINDIR)/$(CONFIG)/lame_client_test
load_file_test: $(BINDIR)/$(CONFIG)/load_file_test
Expand Down Expand Up @@ -1526,9 +1523,6 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/init_test \
$(BINDIR)/$(CONFIG)/inproc_callback_test \
$(BINDIR)/$(CONFIG)/invalid_call_argument_test \
$(BINDIR)/$(CONFIG)/json_rewrite \
$(BINDIR)/$(CONFIG)/json_rewrite_test \
$(BINDIR)/$(CONFIG)/json_stream_error_test \
$(BINDIR)/$(CONFIG)/json_test \
$(BINDIR)/$(CONFIG)/lame_client_test \
$(BINDIR)/$(CONFIG)/load_file_test \
Expand Down Expand Up @@ -2135,10 +2129,6 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/inproc_callback_test || ( echo test inproc_callback_test failed ; exit 1 )
$(E) "[RUN] Testing invalid_call_argument_test"
$(Q) $(BINDIR)/$(CONFIG)/invalid_call_argument_test || ( echo test invalid_call_argument_test failed ; exit 1 )
$(E) "[RUN] Testing json_rewrite_test"
$(Q) $(BINDIR)/$(CONFIG)/json_rewrite_test || ( echo test json_rewrite_test failed ; exit 1 )
$(E) "[RUN] Testing json_stream_error_test"
$(Q) $(BINDIR)/$(CONFIG)/json_stream_error_test || ( echo test json_stream_error_test failed ; exit 1 )
$(E) "[RUN] Testing json_test"
$(Q) $(BINDIR)/$(CONFIG)/json_test || ( echo test json_test failed ; exit 1 )
$(E) "[RUN] Testing lame_client_test"
Expand Down Expand Up @@ -3711,7 +3701,6 @@ LIBGRPC_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -4176,7 +4165,6 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -4596,7 +4584,6 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -4925,7 +4912,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -5217,7 +5203,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -5838,7 +5823,6 @@ LIBGRPC++_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -7069,7 +7053,6 @@ LIBGRPC++_UNSECURE_SRC = \
src/core/lib/iomgr/wakeup_fd_posix.cc \
src/core/lib/json/json.cc \
src/core/lib/json/json_reader.cc \
src/core/lib/json/json_string.cc \
src/core/lib/json/json_writer.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
Expand Down Expand Up @@ -11857,102 +11840,6 @@ endif
endif


JSON_REWRITE_SRC = \
test/core/json/json_rewrite.cc \

JSON_REWRITE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_REWRITE_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/json_rewrite: openssl_dep_error

else



$(BINDIR)/$(CONFIG)/json_rewrite: $(JSON_REWRITE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(JSON_REWRITE_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/json_rewrite

endif

$(OBJDIR)/$(CONFIG)/test/core/json/json_rewrite.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a

deps_json_rewrite: $(JSON_REWRITE_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(JSON_REWRITE_OBJS:.o=.dep)
endif
endif


JSON_REWRITE_TEST_SRC = \
test/core/json/json_rewrite_test.cc \

JSON_REWRITE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_REWRITE_TEST_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/json_rewrite_test: openssl_dep_error

else



$(BINDIR)/$(CONFIG)/json_rewrite_test: $(JSON_REWRITE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(JSON_REWRITE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/json_rewrite_test

endif

$(OBJDIR)/$(CONFIG)/test/core/json/json_rewrite_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a

deps_json_rewrite_test: $(JSON_REWRITE_TEST_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(JSON_REWRITE_TEST_OBJS:.o=.dep)
endif
endif


JSON_STREAM_ERROR_TEST_SRC = \
test/core/json/json_stream_error_test.cc \

JSON_STREAM_ERROR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_STREAM_ERROR_TEST_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/json_stream_error_test: openssl_dep_error

else



$(BINDIR)/$(CONFIG)/json_stream_error_test: $(JSON_STREAM_ERROR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(JSON_STREAM_ERROR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/json_stream_error_test

endif

$(OBJDIR)/$(CONFIG)/test/core/json/json_stream_error_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a

deps_json_stream_error_test: $(JSON_STREAM_ERROR_TEST_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(JSON_STREAM_ERROR_TEST_OBJS:.o=.dep)
endif
endif


JSON_TEST_SRC = \
test/core/json/json_test.cc \

Expand Down
Loading

0 comments on commit 68df397

Please sign in to comment.