From 2b8bb9844ddf866cdd929963ec3b5e4f0d402ed4 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 16 Apr 2019 19:09:21 -0400 Subject: [PATCH 01/29] Implement SpdyUnsafeArena using SpdySimpleArena. Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 16 ++++++++++++++++ bazel/repository_locations.bzl | 6 +++--- .../quic_listeners/quiche/platform/BUILD | 12 +++++++++++- .../quiche/platform/quic_logging_impl.h | 2 ++ .../quiche/platform/spdy_unsafe_arena_impl.h | 5 +++-- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index d3b82aad1b915..d401bb8c37b4a 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -89,6 +89,7 @@ cc_library( "quiche/spdy/platform/api/spdy_ptr_util.h", "quiche/spdy/platform/api/spdy_string.h", "quiche/spdy/platform/api/spdy_string_piece.h", + "quiche/spdy/platform/api/spdy_unsafe_arena.h", # TODO: uncomment the following files as implementations are added. # "quiche/spdy/platform/api/spdy_flags.h", ] + envoy_select_quiche( @@ -103,6 +104,21 @@ cc_library( deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_impl_lib"], ) +cc_library( + name = "spdy_simple_arena_lib", + srcs = ["quiche/spdy/core/spdy_simple_arena.cc"], + hdrs = ["quiche/spdy/core/spdy_simple_arena.h"], + visibility = ["//visibility:public"], + deps = [":spdy_platform"], +) + +cc_library( + name = "spdy_platform_unsafe_arena_lib", + hdrs = ["quiche/spdy/platform/api/spdy_unsafe_arena.h"], + visibility = ["//visibility:public"], + deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_unsafe_arena_impl_lib"], +) + cc_library( name = "quic_platform", srcs = ["quiche/quic/platform/api/quic_mutex.cc"] + envoy_select_quiche( diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index f2f8671998833..afac13ec52d8a 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -236,8 +236,8 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/google/subpar/archive/1.3.0.tar.gz"], ), com_googlesource_quiche = dict( - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/ba6354aa1b39f3d9788ead909ad3e678ac863938.tar.gz - sha256 = "4598537810c3d343c32333c5367fcb652638018118f7f4e844e080405d9e73bb", - urls = ["https://storage.googleapis.com/quiche-envoy-integration/ba6354aa1b39f3d9788ead909ad3e678ac863938.tar.gz"], + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/840edb6d672931ff936004fc35a82ecac6060844.tar.gz + sha256 = "1aba26cec596e9f3b52d93fe40e1640c854e3a4c8949e362647f67eb8e2382e3", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/840edb6d672931ff936004fc35a82ecac6060844.tar.gz"], ), ) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 0cfc9373b4e9c..f290bc635f3d0 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -189,7 +189,6 @@ envoy_cc_library( "spdy_string_piece_impl.h", "spdy_test_helpers_impl.h", "spdy_test_utils_prod_impl.h", - "spdy_unsafe_arena_impl.h", ] + envoy_select_quiche([ "spdy_bug_tracker_impl.h", "spdy_logging_impl.h", @@ -209,3 +208,14 @@ envoy_cc_library( "//source/common/common:assert_lib", ]), ) + +envoy_cc_library( + name = "spdy_platform_unsafe_arena_impl_lib", + hdrs = [ + "spdy_unsafe_arena_impl.h", + ], + visibility = ["//visibility:public"], + deps = envoy_select_quiche([ + "@com_googlesource_quiche//:spdy_simple_arena_lib", + ]), +) diff --git a/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h index bf4e426616fa1..131e6292068d0 100644 --- a/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h @@ -82,6 +82,8 @@ #define QUIC_NOTREACHED_IMPL() NOT_REACHED_GCOVR_EXCL_LINE #endif +#define DCHECK_GE(a, b) DCHECK((a) >= (b)) + #define QUIC_PREDICT_FALSE_IMPL(x) ABSL_PREDICT_FALSE(x) namespace quic { diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_unsafe_arena_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_unsafe_arena_impl.h index 8db8e4a20bd44..d731d001dcef0 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_unsafe_arena_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_unsafe_arena_impl.h @@ -6,9 +6,10 @@ // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. +#include "quiche/spdy/core/spdy_simple_arena.h" + namespace spdy { -// TODO: implement -class SpdyUnsafeArenaImpl {}; +using SpdyUnsafeArenaImpl = SpdySimpleArena; } // namespace spdy From 4cdc39f59068e742e2c4f0223532169e861993e3 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 16 Apr 2019 19:12:28 -0400 Subject: [PATCH 02/29] de-dup header file Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index d401bb8c37b4a..2b65a5dddd787 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -89,7 +89,6 @@ cc_library( "quiche/spdy/platform/api/spdy_ptr_util.h", "quiche/spdy/platform/api/spdy_string.h", "quiche/spdy/platform/api/spdy_string_piece.h", - "quiche/spdy/platform/api/spdy_unsafe_arena.h", # TODO: uncomment the following files as implementations are added. # "quiche/spdy/platform/api/spdy_flags.h", ] + envoy_select_quiche( From 9a925f0dca10fce6ba4d039d63a779f973224a88 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Wed, 17 Apr 2019 17:53:38 -0400 Subject: [PATCH 03/29] fix macros, blocked by linked_hash_map Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 34 +++++++++++++++++++ bazel/external/quiche.genrule_cmd | 3 ++ bazel/repository_locations.bzl | 6 ++-- .../quiche/platform/quic_logging_impl.h | 5 +++ .../quiche/platform/spdy_macros_impl.h | 3 -- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 2b65a5dddd787..a7eead9318308 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -29,6 +29,7 @@ load(":genrule_cmd.bzl", "genrule_cmd") load( "@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", + "envoy_copts", "envoy_select_quiche", ) @@ -85,6 +86,7 @@ cc_library( "quiche/spdy/platform/api/spdy_endianness_util.h", "quiche/spdy/platform/api/spdy_estimate_memory_usage.h", "quiche/spdy/platform/api/spdy_export.h", + "quiche/spdy/platform/api/spdy_macros.h", "quiche/spdy/platform/api/spdy_mem_slice.h", "quiche/spdy/platform/api/spdy_ptr_util.h", "quiche/spdy/platform/api/spdy_string.h", @@ -118,6 +120,28 @@ cc_library( deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_unsafe_arena_impl_lib"], ) +cc_library( + name = "quiche_spdy_core_lib", + hdrs = [ + "quiche/spdy/core/spdy_header_block.cc", + "quiche/spdy/core/spdy_test_utils.cc", + ], + srcs = [ + "quiche/spdy/core/spdy_alt_svc_wire_format.h", + "quiche/spdy/core/spdy_bitmasks.h", + "quiche/spdy/core/spdy_header_block.h", + "quiche/spdy/core/spdy_headers_handler_interface.h", + "quiche/spdy/core/spdy_protocol.h", + "quiche/spdy/core/spdy_test_utils.h", + ], + copts = envoy_copts("@envoy") + ["-Wno-unused-parameter",], + visibility = ["//visibility:public"], + deps = [ + ":spdy_platform", + ":spdy_platform_unsafe_arena_lib", + ], +) + cc_library( name = "quic_platform", srcs = ["quiche/quic/platform/api/quic_mutex.cc"] + envoy_select_quiche( @@ -273,6 +297,16 @@ envoy_cc_test( deps = [":spdy_platform"], ) +envoy_cc_test( + name = "quiche_spdy_core_test", + srcs = ["quiche/spdy/core/spdy_header_block_test.cc",], + repository = "@envoy", + deps = [ + ":spdy_platform", + ":quiche_spdy_core_lib", + ], +) + envoy_cc_test( name = "quic_platform_test", srcs = envoy_select_quiche( diff --git a/bazel/external/quiche.genrule_cmd b/bazel/external/quiche.genrule_cmd index 3993d532a29b4..0e1d5a390f38b 100644 --- a/bazel/external/quiche.genrule_cmd +++ b/bazel/external/quiche.genrule_cmd @@ -30,6 +30,9 @@ cat <sed_commands # Rewrite third_party includes. /^#include/ s!third_party/boringssl/src/include/!! +# Rewrite gmock includes. +/^#include/ s!testing/gmock/include/gmock/!gmock/! + EOF for src_file in $(SRCS); do diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index afac13ec52d8a..f62d3214a8d79 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -236,8 +236,8 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/google/subpar/archive/1.3.0.tar.gz"], ), com_googlesource_quiche = dict( - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/840edb6d672931ff936004fc35a82ecac6060844.tar.gz - sha256 = "1aba26cec596e9f3b52d93fe40e1640c854e3a4c8949e362647f67eb8e2382e3", - urls = ["https://storage.googleapis.com/quiche-envoy-integration/840edb6d672931ff936004fc35a82ecac6060844.tar.gz"], + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/bcfea901dbd89f6c23ca9e5a3792d22155ebeea9.tar.gz + sha256 = "b4fa5a33624fc35c32e47ce1f235d8746fc51d8f3234b38a8f605b16b5a4d9e9", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/bcfea901dbd89f6c23ca9e5a3792d22155ebeea9.tar.gz"], ), ) diff --git a/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h index 131e6292068d0..b77f422accdd0 100644 --- a/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quic_logging_impl.h @@ -82,7 +82,12 @@ #define QUIC_NOTREACHED_IMPL() NOT_REACHED_GCOVR_EXCL_LINE #endif +#define DCHECK_GT(a, b) DCHECK((a) > (b)) #define DCHECK_GE(a, b) DCHECK((a) >= (b)) +#define DCHECK_LT(a, b) DCHECK((a) < (b)) +#define DCHECK_LE(a, b) DCHECK((a) <= (b)) +#define DCHECK_NE(a, b) DCHECK((a) != (b)) +#define DCHECK_EQ(a, b) DCHECK((a) == (b)) #define QUIC_PREDICT_FALSE_IMPL(x) ABSL_PREDICT_FALSE(x) diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_macros_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_macros_impl.h index 1cec4845b1e15..9b38f29695e68 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_macros_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_macros_impl.h @@ -10,6 +10,3 @@ #define SPDY_MUST_USE_RESULT_IMPL ABSL_MUST_USE_RESULT #define SPDY_UNUSED_IMPL ABSL_ATTRIBUTE_UNUSED - -// TODO: implement -#define SPDY_DVLOG_IF_IMPL 0 From 8d15493f6d2abd9e100824a405ac32335d81ae80 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 30 Apr 2019 17:40:03 -0400 Subject: [PATCH 04/29] update tar ball Signed-off-by: Dan Zhang --- bazel/repository_locations.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index f62d3214a8d79..dc57f2a9a3913 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -236,8 +236,8 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/google/subpar/archive/1.3.0.tar.gz"], ), com_googlesource_quiche = dict( - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/bcfea901dbd89f6c23ca9e5a3792d22155ebeea9.tar.gz - sha256 = "b4fa5a33624fc35c32e47ce1f235d8746fc51d8f3234b38a8f605b16b5a4d9e9", - urls = ["https://storage.googleapis.com/quiche-envoy-integration/bcfea901dbd89f6c23ca9e5a3792d22155ebeea9.tar.gz"], + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/c703612c85f2b72c2c4e91956f48a27eb7f4833f.tar.gz + sha256 = "901bbf027a13bb8bf24e42376b00dc637a84862550c6d92ec297a5aebeb01880", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/c703612c85f2b72c2c4e91956f48a27eb7f4833f.tar.gz"], ), ) From b5b2a94759824fc9663365d37dcf711602198aed Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 12:44:05 -0400 Subject: [PATCH 05/29] plug in SimpleLinkedHashMap Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 92 +++++++++++-------- bazel/external/quiche.genrule_cmd | 6 +- bazel/repository_locations.bzl | 6 +- .../quic_listeners/quiche/platform/BUILD | 14 +++ .../quiche/platform/quic_containers_impl.h | 12 +-- .../quiche/platform/quiche_logging_impl.h | 9 ++ .../quiche/platform/quiche_ptr_util_impl.h | 17 ++++ .../quiche/platform/quiche_test_impl.h | 10 ++ .../quiche_unordered_containers_impl.h | 20 ++++ .../quiche/platform/spdy_containers_impl.h | 17 ++-- .../quic_listeners/quiche/platform/BUILD | 5 + .../quiche/platform/quiche_test_impl.h | 10 ++ 12 files changed, 159 insertions(+), 59 deletions(-) create mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h create mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_ptr_util_impl.h create mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h create mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h create mode 100644 test/extensions/quic_listeners/quiche/platform/quiche_test_impl.h diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 1e1f34b2678f5..ed6f9520672aa 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -30,11 +30,7 @@ load( "@envoy//bazel:envoy_build_system.bzl", "envoy_cc_library", "envoy_cc_test", -<<<<<<< HEAD - "envoy_copts", -======= "envoy_cc_test_library", ->>>>>>> master "envoy_select_quiche", ) @@ -109,7 +105,7 @@ envoy_cc_library( "quiche/spdy/platform/api/spdy_endianness_util.h", "quiche/spdy/platform/api/spdy_estimate_memory_usage.h", "quiche/spdy/platform/api/spdy_export.h", - "quiche/spdy/platform/api/spdy_macros.h", + "quiche/spdy/platform/api/spdy_macros.h", "quiche/spdy/platform/api/spdy_mem_slice.h", "quiche/spdy/platform/api/spdy_ptr_util.h", "quiche/spdy/platform/api/spdy_string.h", @@ -129,27 +125,15 @@ envoy_cc_library( deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_impl_lib"], ) -<<<<<<< HEAD -cc_library( - name = "spdy_simple_arena_lib", - srcs = ["quiche/spdy/core/spdy_simple_arena.cc"], - hdrs = ["quiche/spdy/core/spdy_simple_arena.h"], -======= envoy_cc_library( name = "spdy_simple_arena_lib", srcs = ["quiche/spdy/core/spdy_simple_arena.cc"], hdrs = ["quiche/spdy/core/spdy_simple_arena.h"], repository = "@envoy", ->>>>>>> master visibility = ["//visibility:public"], deps = [":spdy_platform"], ) -<<<<<<< HEAD -cc_library( - name = "spdy_platform_unsafe_arena_lib", - hdrs = ["quiche/spdy/platform/api/spdy_unsafe_arena.h"], -======= envoy_cc_test_library( name = "spdy_platform_test_helpers", hdrs = ["quiche/spdy/platform/api/spdy_test_helpers.h"], @@ -161,38 +145,34 @@ envoy_cc_library( name = "spdy_platform_unsafe_arena_lib", hdrs = ["quiche/spdy/platform/api/spdy_unsafe_arena.h"], repository = "@envoy", ->>>>>>> master visibility = ["//visibility:public"], deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_unsafe_arena_impl_lib"], ) -<<<<<<< HEAD -cc_library( +envoy_cc_library( name = "quiche_spdy_core_lib", - hdrs = [ - "quiche/spdy/core/spdy_header_block.cc", - "quiche/spdy/core/spdy_test_utils.cc", - ], srcs = [ + "quiche/spdy/core/spdy_header_block.cc", + "quiche/spdy/core/spdy_test_utils.cc", + ], + hdrs = [ "quiche/spdy/core/spdy_alt_svc_wire_format.h", - "quiche/spdy/core/spdy_bitmasks.h", - "quiche/spdy/core/spdy_header_block.h", + "quiche/spdy/core/spdy_bitmasks.h", + "quiche/spdy/core/spdy_header_block.h", "quiche/spdy/core/spdy_headers_handler_interface.h", - "quiche/spdy/core/spdy_protocol.h", - "quiche/spdy/core/spdy_test_utils.h", + "quiche/spdy/core/spdy_protocol.h", + "quiche/spdy/core/spdy_test_utils.h", ], - copts = envoy_copts("@envoy") + ["-Wno-unused-parameter",], + copts = quiche_copt, + repository = "@envoy", visibility = ["//visibility:public"], deps = [ - ":spdy_platform", - ":spdy_platform_unsafe_arena_lib", + ":spdy_platform", + ":spdy_platform_unsafe_arena_lib", ], ) -cc_library( -======= envoy_cc_library( ->>>>>>> master name = "quic_platform", srcs = ["quiche/quic/platform/api/quic_mutex.cc"] + envoy_select_quiche( [ @@ -410,6 +390,32 @@ envoy_cc_test_library( deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quic_platform_epoll_impl_lib"], ) +envoy_cc_library( + name = "quiche_common_platform", + hdrs = [ + "quiche/common/platform/api/quiche_logging.h", + "quiche/common/platform/api/quiche_ptr_util.h", + "quiche/common/platform/api/quiche_unordered_containers.h", + ], + repository = "@envoy", + deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_impl_lib"], +) + +envoy_cc_test_library( + name = "quiche_common_platform_test", + hdrs = ["quiche/common/platform/api/quiche_test.h"], + repository = "@envoy", + deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quiche_common_platform_test_impl_lib"], +) + +envoy_cc_library( + name = "quiche_common_lib", + hdrs = ["quiche/common/simple_linked_hash_map.h"], + repository = "@envoy", + visibility = ["//visibility:public"], + deps = [":quiche_common_platform"], +) + envoy_cc_test( name = "epoll_server_test", srcs = ["quiche/epoll_server/simple_epoll_server_test.cc"], @@ -418,6 +424,17 @@ envoy_cc_test( deps = [":epoll_server_lib"], ) +envoy_cc_test( + name = "quiche_common_test", + srcs = ["quiche/common/simple_linked_hash_map_test.cc"], + copts = quiche_copt, + repository = "@envoy", + deps = [ + ":quiche_common_lib", + ":quiche_common_platform_test", + ], +) + envoy_cc_test( name = "http2_platform_api_test", srcs = [ @@ -443,11 +460,12 @@ envoy_cc_test( envoy_cc_test( name = "quiche_spdy_core_test", - srcs = ["quiche/spdy/core/spdy_header_block_test.cc",], + srcs = ["quiche/spdy/core/spdy_header_block_test.cc"], + copts = quiche_copt, repository = "@envoy", deps = [ - ":spdy_platform", - ":quiche_spdy_core_lib", + ":quiche_spdy_core_lib", + ":spdy_platform", ], ) diff --git a/bazel/external/quiche.genrule_cmd b/bazel/external/quiche.genrule_cmd index cdb2fab3dfbd2..d035bdfa91ddc 100644 --- a/bazel/external/quiche.genrule_cmd +++ b/bazel/external/quiche.genrule_cmd @@ -27,10 +27,11 @@ cat <sed_commands /^#include/ s!net/quic/platform/impl/quic_test_impl.h!test/extensions/quic_listeners/quiche/platform/quic_test_impl.h! /^#include/ s!net/quic/platform/impl/quic_test_output_impl.h!test/extensions/quic_listeners/quiche/platform/quic_test_output_impl.h! /^#include/ s!net/quic/platform/impl/quic_thread_impl.h!test/extensions/quic_listeners/quiche/platform/quic_thread_impl.h! +/^#include/ s!net/quiche/common/platform/impl/quiche_test_impl.h!test/extensions/quic_listeners/quiche/platform/quiche_test_impl.h! /^#include/ s!net/spdy/platform/impl/spdy_test_helpers_impl.h!test/extensions/quic_listeners/quiche/platform/spdy_test_helpers_impl.h! # Rewrite include directives for platform impl files. -/^#include/ s!net/(http2|spdy|quic)/platform/impl/!extensions/quic_listeners/quiche/platform/! +/^#include/ s!net/(http2|spdy|quic|quiche/common)/platform/impl/!extensions/quic_listeners/quiche/platform/! # Rewrite include directives for epoll_server platform impl files. /^#include/ s!net/tools/epoll_server/platform/impl!test/extensions/quic_listeners/quiche/platform/! @@ -45,9 +46,6 @@ cat <sed_commands # Rewrite third_party includes. /^#include/ s!third_party/boringssl/src/include/!! -# Rewrite gmock includes. -/^#include/ s!testing/gmock/include/gmock/!gmock/! - EOF for src_file in $(SRCS); do diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 3b3fd153b52d4..9c2a60199ae3d 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -240,8 +240,8 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/google/subpar/archive/1.3.0.tar.gz"], ), com_googlesource_quiche = dict( - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/c703612c85f2b72c2c4e91956f48a27eb7f4833f.tar.gz - sha256 = "901bbf027a13bb8bf24e42376b00dc637a84862550c6d92ec297a5aebeb01880", - urls = ["https://storage.googleapis.com/quiche-envoy-integration/c703612c85f2b72c2c4e91956f48a27eb7f4833f.tar.gz"], + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/7bf7c3c358eb954e463bde14ea27444f4bd8ea05.tar.gz + sha256 = "36fe180d532a9ccb18cd32328af5231636c7408104523f9ed5eebbad75f1e039", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/7bf7c3c358eb954e463bde14ea27444f4bd8ea05.tar.gz"], ), ) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 2f1ebe8ef3475..a96a846fccdf4 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -154,6 +154,19 @@ envoy_cc_library( ]), ) +envoy_cc_library( + name = "quiche_common_platform_impl_lib", + hdrs = [ + "quiche_logging_impl.h", + "quiche_ptr_util_impl.h", + "quiche_unordered_containers_impl.h", + ], + external_deps = [ + "abseil_node_hash_map", + ], + deps = [":quic_platform_base_impl_lib"], +) + envoy_cc_library( name = "quic_platform_sleep_impl_lib", hdrs = ["quic_sleep_impl.h"], @@ -193,6 +206,7 @@ envoy_cc_library( ":quic_platform_logging_impl_lib", ":string_utils_lib", "//source/common/common:assert_lib", + "@com_googlesource_quiche//:quiche_common_lib", ]), ) diff --git a/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h index 8d1a08953a42b..68fa2b616404b 100644 --- a/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h @@ -10,6 +10,7 @@ #include "absl/container/inlined_vector.h" #include "absl/container/node_hash_map.h" #include "absl/container/node_hash_set.h" +#include "quiche/common/simple_linked_hash_map.h" // NOLINT(namespace-envoy) @@ -26,14 +27,11 @@ using QuicUnorderedMapImpl = absl::node_hash_map; template using QuicUnorderedSetImpl = absl::node_hash_set; -// TODO: implement -template class QuicLinkedHashMapImpl {}; - -// TODO: implement -template class QuicSmallMapImpl {}; +template +using QuicLinkedHashMapImpl = quiche::SimpleLinkedHashMap; -// TODO: implement -template class QuicIntervalSetImpl; +template +using QuicSmallMapImpl = std::unordered_map; template using QuicQueueImpl = std::queue; diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h new file mode 100644 index 0000000000000..26e5f7662630b --- /dev/null +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h @@ -0,0 +1,9 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +#include "extensions/quic_listeners/quiche/platform/quic_logging_impl.h" diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_ptr_util_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_ptr_util_impl.h new file mode 100644 index 0000000000000..e5ed8a2714d04 --- /dev/null +++ b/source/extensions/quic_listeners/quiche/platform/quiche_ptr_util_impl.h @@ -0,0 +1,17 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +#include + +namespace quiche { + +template std::unique_ptr QuicheMakeUniqueImpl(Args&&... args) { + return std::make_unique(std::forward(args)...); +} + +} // namespace quiche diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h new file mode 100644 index 0000000000000..e351735c3ab15 --- /dev/null +++ b/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h @@ -0,0 +1,10 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +#include "gmock/gmock.h" +#include "gtest/gtest.h" diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h new file mode 100644 index 0000000000000..9ba1931ae1a69 --- /dev/null +++ b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h @@ -0,0 +1,20 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +#include "absl/container/node_hash_map.h" + +namespace quiche { + +// The default hasher used by hash tables. +template using QuicheDefaultHasherImpl = absl::Hash; + +// Similar to std::unordered_map, but with better performance and memory usage. +template +using QuicheUnorderedMapImpl = absl::node_hash_map; + +} // namespace quiche diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h index 00c145d8381ad..9a4c17e26aba3 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h @@ -1,5 +1,11 @@ #pragma once +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" #include "absl/container/inlined_vector.h" @@ -14,12 +20,7 @@ // TODO(mpw): fix includes to use full paths. #include "spdy_string_impl.h" #include "spdy_string_piece_impl.h" - -// NOLINT(namespace-envoy) - -// This file is part of the QUICHE platform implementation, and is not to be -// consumed or referenced directly by other Envoy code. It serves purely as a -// porting layer for QUICHE. +#include "quiche/common/simple_linked_hash_map.h" namespace spdy { @@ -31,8 +32,8 @@ using SpdyHashMapImpl = absl::flat_hash_map; template using SpdyHashSetImpl = absl::flat_hash_set; -// TODO: implement -template class SpdyLinkedHashMapImpl {}; +template +using SpdyLinkedHashMapImpl = quiche::SimpleLinkedHashMap; template > using SpdyInlinedVectorImpl = absl::InlinedVector; diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index fa29ddfa12126..604dc3e596f6d 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -164,6 +164,11 @@ envoy_cc_test_library( ], ) +envoy_cc_test_library( + name = "quiche_common_platform_test_impl_lib", + hdrs = ["quiche_test_impl.h"], +) + envoy_cc_test_library( name = "spdy_platform_test_helpers_impl_lib", hdrs = ["spdy_test_helpers_impl.h"], diff --git a/test/extensions/quic_listeners/quiche/platform/quiche_test_impl.h b/test/extensions/quic_listeners/quiche/platform/quiche_test_impl.h new file mode 100644 index 0000000000000..e351735c3ab15 --- /dev/null +++ b/test/extensions/quic_listeners/quiche/platform/quiche_test_impl.h @@ -0,0 +1,10 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +#include "gmock/gmock.h" +#include "gtest/gtest.h" From 05df3ee9db65135924cdfbc01204cdea29e5fade Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 12:45:46 -0400 Subject: [PATCH 06/29] format Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index a96a846fccdf4..2450c966af752 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -161,9 +161,7 @@ envoy_cc_library( "quiche_ptr_util_impl.h", "quiche_unordered_containers_impl.h", ], - external_deps = [ - "abseil_node_hash_map", - ], + external_deps = ["abseil_node_hash_map"], deps = [":quic_platform_base_impl_lib"], ) From 9e1bb6627ae054869ba86a506159ebb0e85c48b4 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 14:01:46 -0400 Subject: [PATCH 07/29] add visibility Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 335f935bb7396..474ce8c88d676 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -181,6 +181,7 @@ envoy_cc_library( "quiche_unordered_containers_impl.h", ], external_deps = ["abseil_node_hash_map"], + visibility = ["//visibility:public"], deps = [":quic_platform_base_impl_lib"], ) From af85c9c714c1fc1393171fb338e16b3e51e01ca8 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 15:00:21 -0400 Subject: [PATCH 08/29] fix depenedency Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 37a0b471d57ef..0a4d2b85cf704 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -121,7 +121,10 @@ envoy_cc_library( ), repository = "@envoy", visibility = ["//visibility:public"], - deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_impl_lib"], + deps = [ + ":quiche_common_lib", + "@envoy//source/extensions/quic_listeners/quiche/platform:spdy_platform_impl_lib", + ], ) envoy_cc_library( @@ -305,6 +308,7 @@ envoy_cc_library( visibility = ["//visibility:public"], deps = [ ":quic_platform_export", + ":quiche_common_lib", "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_base_impl_lib", ], ) From 55665ca943facd3883f65475e242fd21bf490157 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 16:25:54 -0400 Subject: [PATCH 09/29] add visibility Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 0a4d2b85cf704..3e72a0c39db03 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -401,6 +401,7 @@ envoy_cc_library( "quiche/common/platform/api/quiche_unordered_containers.h", ], repository = "@envoy", + visibility = ["//visibility:public"], deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_impl_lib"], ) From d2f96419781e57aa4b728111949909aeb01e6ef8 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 2 May 2019 17:25:41 -0400 Subject: [PATCH 10/29] add quic_containers_test Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 3e72a0c39db03..54808a514310c 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -477,6 +477,7 @@ envoy_cc_test( name = "quic_platform_api_test", srcs = envoy_select_quiche( [ + "quiche/quic/platform/api/quic_containers_test.cc", "quiche/quic/platform/api/quic_endian_test.cc", "quiche/quic/platform/api/quic_reference_counted_test.cc", "quiche/quic/platform/api/quic_string_utils_test.cc", From 5fce0101ae365686632edfe8f8796cec8bff5e24 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Fri, 3 May 2019 10:47:16 -0400 Subject: [PATCH 11/29] inline some impl functions Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 2 +- .../quic_listeners/quiche/platform/spdy_string_utils_impl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 54808a514310c..41840c5a919d0 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -477,7 +477,7 @@ envoy_cc_test( name = "quic_platform_api_test", srcs = envoy_select_quiche( [ - "quiche/quic/platform/api/quic_containers_test.cc", + "quiche/quic/platform/api/quic_containers_test.cc", "quiche/quic/platform/api/quic_endian_test.cc", "quiche/quic/platform/api/quic_reference_counted_test.cc", "quiche/quic/platform/api/quic_string_utils_test.cc", diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_string_utils_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_string_utils_impl.h index e2af90641e43f..20a44e88d120a 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_string_utils_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_string_utils_impl.h @@ -24,13 +24,13 @@ inline void SpdyStrAppendImpl(std::string* output, const Args&... args) { absl::StrAppend(output, std::forward(args)...); } -char SpdyHexDigitToIntImpl(char c) { return quiche::HexDigitToInt(c); } +inline char SpdyHexDigitToIntImpl(char c) { return quiche::HexDigitToInt(c); } inline std::string SpdyHexDecodeImpl(absl::string_view data) { return absl::HexStringToBytes(data); } -bool SpdyHexDecodeToUInt32Impl(absl::string_view data, uint32_t* out) { +inline bool SpdyHexDecodeToUInt32Impl(absl::string_view data, uint32_t* out) { return quiche::HexDecodeToUInt32(data, out); } @@ -42,6 +42,6 @@ inline std::string SpdyHexEncodeUInt32AndTrimImpl(uint32_t data) { return absl::StrCat(absl::Hex(data)); } -std::string SpdyHexDumpImpl(absl::string_view data) { return quiche::HexDump(data); } +inline std::string SpdyHexDumpImpl(absl::string_view data) { return quiche::HexDump(data); } } // namespace spdy From 7f1e1533657798e541e9b87c3cf918fd93748265 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Mon, 6 May 2019 15:18:56 -0400 Subject: [PATCH 12/29] break down spdy_core_lib Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 69 ++++++++++++++++--- .../quiche/platform/quic_containers_impl.h | 4 +- .../quiche/platform/quiche_test_impl.h | 10 --- .../quiche/platform/spdy_containers_impl.h | 10 +-- 4 files changed, 63 insertions(+), 30 deletions(-) delete mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 41840c5a919d0..bf0ef0cd6522b 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -152,18 +152,24 @@ envoy_cc_library( ) envoy_cc_library( - name = "quiche_spdy_core_lib", + name = "spdy_core_spdy_alt_svc_wire_format_lib", + srcs = ["quiche/spdy/core/spdy_alt_svc_wire_format.cc"], + hdrs = ["quiche/spdy/core/spdy_alt_svc_wire_format.h"], + copts = quiche_copt, + repository = "@envoy", + visibility = ["//visibility:public"], + deps = [ + ":spdy_platform", + ], +) + +envoy_cc_library( + name = "spdy_core_spdy_header_block_lib", srcs = [ "quiche/spdy/core/spdy_header_block.cc", - "quiche/spdy/core/spdy_test_utils.cc", ], hdrs = [ - "quiche/spdy/core/spdy_alt_svc_wire_format.h", - "quiche/spdy/core/spdy_bitmasks.h", "quiche/spdy/core/spdy_header_block.h", - "quiche/spdy/core/spdy_headers_handler_interface.h", - "quiche/spdy/core/spdy_protocol.h", - "quiche/spdy/core/spdy_test_utils.h", ], copts = quiche_copt, repository = "@envoy", @@ -174,6 +180,49 @@ envoy_cc_library( ], ) +envoy_cc_library( + name = "spdy_core_spdy_headers_handler_interface", + hdrs = ["quiche/spdy/core/spdy_headers_handler_interface.h"], + copts = quiche_copt, + repository = "@envoy", + visibility = ["//visibility:public"], + deps = [":spdy_platform"], +) + +envoy_cc_library( + name = "spdy_core_spdy_protocol_lib", + hdrs = [ + "quiche/spdy/core/spdy_bitmasks.h", + "quiche/spdy/core/spdy_protocol.h", + ], + copts = quiche_copt, + repository = "@envoy", + visibility = ["//visibility:public"], + deps = [ + ":spdy_core_spdy_alt_svc_wire_format_lib", + ":spdy_core_spdy_header_block_lib", + ":spdy_platform", + ], +) + +envoy_cc_test_library( + name = "spdy_core_spdy_test_utils_lib", + srcs = [ + "quiche/spdy/core/spdy_test_utils.cc", + ], + hdrs = [ + "quiche/spdy/core/spdy_test_utils.h", + ], + copts = quiche_copt, + repository = "@envoy", + deps = [ + ":spdy_core_spdy_header_block_lib", + ":spdy_core_spdy_headers_handler_interface", + ":spdy_core_spdy_protocol_lib", + ":spdy_platform", + ], +) + envoy_cc_library( name = "quic_platform", srcs = ["quiche/quic/platform/api/quic_mutex.cc"] + envoy_select_quiche( @@ -463,13 +512,13 @@ envoy_cc_test( ) envoy_cc_test( - name = "quiche_spdy_core_test", + name = "spdy_header_block_test", srcs = ["quiche/spdy/core/spdy_header_block_test.cc"], copts = quiche_copt, repository = "@envoy", deps = [ - ":quiche_spdy_core_lib", - ":spdy_platform", + ":spdy_core_spdy_header_block_lib", + ":spdy_core_spdy_test_utils_lib", ], ) diff --git a/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h index 68fa2b616404b..e2638f8e21bf3 100644 --- a/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quic_containers_impl.h @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include "absl/container/flat_hash_map.h" #include "absl/container/inlined_vector.h" @@ -31,7 +29,7 @@ template using QuicLinkedHashMapImpl = quiche::SimpleLinkedHashMap; template -using QuicSmallMapImpl = std::unordered_map; +using QuicSmallMapImpl = absl::flat_hash_map; template using QuicQueueImpl = std::queue; diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h deleted file mode 100644 index e351735c3ab15..0000000000000 --- a/source/extensions/quic_listeners/quiche/platform/quiche_test_impl.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -// NOLINT(namespace-envoy) - -// This file is part of the QUICHE platform implementation, and is not to be -// consumed or referenced directly by other Envoy code. It serves purely as a -// porting layer for QUICHE. - -#include "gmock/gmock.h" -#include "gtest/gtest.h" diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h index 9a4c17e26aba3..05f5febcc06b6 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h @@ -11,15 +11,11 @@ #include "absl/container/inlined_vector.h" #include "absl/hash/hash.h" -// The following includes should be: -// -// #include "extensions/quic_listeners/quiche/platform/spdy_string_impl.h" -// #include "extensions/quic_listeners/quiche/platform/spdy_string_piece_impl.h" // // However, for some reason, bazel.clang_tidy cannot resolve the files when specified this way. -// TODO(mpw): fix includes to use full paths. -#include "spdy_string_impl.h" -#include "spdy_string_piece_impl.h" + +#include "extensions/quic_listeners/quiche/platform/spdy_string_impl.h" +#include "extensions/quic_listeners/quiche/platform/spdy_string_piece_impl.h" #include "quiche/common/simple_linked_hash_map.h" namespace spdy { From ca59554c5290abf08843c1a260fd8df126857e30 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Mon, 6 May 2019 18:19:02 -0400 Subject: [PATCH 13/29] fix #include Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 5 ++++- .../quiche/platform/quiche_unordered_containers_impl.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 474ce8c88d676..3fb4c3cb32736 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -180,7 +180,10 @@ envoy_cc_library( "quiche_ptr_util_impl.h", "quiche_unordered_containers_impl.h", ], - external_deps = ["abseil_node_hash_map"], + external_deps = [ + "abseil_hash", + "abseil_node_hash_map", + ], visibility = ["//visibility:public"], deps = [":quic_platform_base_impl_lib"], ) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h index 9ba1931ae1a69..ad0f60bdee2ff 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h @@ -6,6 +6,7 @@ // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. +#include "absl/hash/hash.h" #include "absl/container/node_hash_map.h" namespace quiche { From f2c37c72b9a214739c0c4e07862b3ecf331570a4 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 7 May 2019 13:39:46 -0400 Subject: [PATCH 14/29] fix format Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 46 ++++++++----------- .../quiche_unordered_containers_impl.h | 2 +- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index bf0ef0cd6522b..1c89642988bec 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -152,25 +152,19 @@ envoy_cc_library( ) envoy_cc_library( - name = "spdy_core_spdy_alt_svc_wire_format_lib", + name = "spdy_core_alt_svc_wire_format_lib", srcs = ["quiche/spdy/core/spdy_alt_svc_wire_format.cc"], hdrs = ["quiche/spdy/core/spdy_alt_svc_wire_format.h"], copts = quiche_copt, repository = "@envoy", visibility = ["//visibility:public"], - deps = [ - ":spdy_platform", - ], + deps = [":spdy_platform"], ) envoy_cc_library( - name = "spdy_core_spdy_header_block_lib", - srcs = [ - "quiche/spdy/core/spdy_header_block.cc", - ], - hdrs = [ - "quiche/spdy/core/spdy_header_block.h", - ], + name = "spdy_core_header_block_lib", + srcs = ["quiche/spdy/core/spdy_header_block.cc"], + hdrs = ["quiche/spdy/core/spdy_header_block.h"], copts = quiche_copt, repository = "@envoy", visibility = ["//visibility:public"], @@ -181,7 +175,7 @@ envoy_cc_library( ) envoy_cc_library( - name = "spdy_core_spdy_headers_handler_interface", + name = "spdy_core_headers_handler_interface", hdrs = ["quiche/spdy/core/spdy_headers_handler_interface.h"], copts = quiche_copt, repository = "@envoy", @@ -190,7 +184,7 @@ envoy_cc_library( ) envoy_cc_library( - name = "spdy_core_spdy_protocol_lib", + name = "spdy_core_protocol_lib", hdrs = [ "quiche/spdy/core/spdy_bitmasks.h", "quiche/spdy/core/spdy_protocol.h", @@ -199,26 +193,22 @@ envoy_cc_library( repository = "@envoy", visibility = ["//visibility:public"], deps = [ - ":spdy_core_spdy_alt_svc_wire_format_lib", - ":spdy_core_spdy_header_block_lib", + ":spdy_core_alt_svc_wire_format_lib", + ":spdy_core_header_block_lib", ":spdy_platform", ], ) envoy_cc_test_library( - name = "spdy_core_spdy_test_utils_lib", - srcs = [ - "quiche/spdy/core/spdy_test_utils.cc", - ], - hdrs = [ - "quiche/spdy/core/spdy_test_utils.h", - ], + name = "spdy_core_test_utils_lib", + srcs = ["quiche/spdy/core/spdy_test_utils.cc"], + hdrs = ["quiche/spdy/core/spdy_test_utils.h"], copts = quiche_copt, repository = "@envoy", deps = [ - ":spdy_core_spdy_header_block_lib", - ":spdy_core_spdy_headers_handler_interface", - ":spdy_core_spdy_protocol_lib", + ":spdy_core_header_block_lib", + ":spdy_core_headers_handler_interface", + ":spdy_core_protocol_lib", ":spdy_platform", ], ) @@ -512,13 +502,13 @@ envoy_cc_test( ) envoy_cc_test( - name = "spdy_header_block_test", + name = "spdy_core_header_block_test", srcs = ["quiche/spdy/core/spdy_header_block_test.cc"], copts = quiche_copt, repository = "@envoy", deps = [ - ":spdy_core_spdy_header_block_lib", - ":spdy_core_spdy_test_utils_lib", + ":spdy_core_header_block_lib", + ":spdy_core_test_utils_lib", ], ) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h index ad0f60bdee2ff..cefb261521b4d 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_unordered_containers_impl.h @@ -6,8 +6,8 @@ // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. -#include "absl/hash/hash.h" #include "absl/container/node_hash_map.h" +#include "absl/hash/hash.h" namespace quiche { From fb42607cec31942b9586779505a92f251b929b53 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Wed, 8 May 2019 17:17:52 -0400 Subject: [PATCH 15/29] fix test deps Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 1 + test/extensions/quic_listeners/quiche/platform/BUILD | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 36363d6d82853..b0dcc352458b8 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -369,6 +369,7 @@ envoy_cc_library( hdrs = ["quiche/quic/core/quic_error_codes.h"], copts = quiche_copt, repository = "@envoy", + visibility = ["//visibility:public"], deps = [":quic_platform_export"], ) diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index 8188f83674ff3..b8e48962bc945 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -44,6 +44,8 @@ envoy_cc_test( "//test/test_common:threadsafe_singleton_injector_lib", "//test/test_common:utility_lib", "@com_googlesource_quiche//:epoll_server_lib", + "@com_googlesource_quiche//:quic_core_types_lib", + "@com_googlesource_quiche//:quic_core_error_codes_lib", "@com_googlesource_quiche//:quic_platform_expect_bug", "@com_googlesource_quiche//:quic_platform_mock_log", "@com_googlesource_quiche//:quic_platform_port_utils", From 60b306abe2a52fe3983e479afe44b7c5a8e827db Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Wed, 8 May 2019 17:21:00 -0400 Subject: [PATCH 16/29] format Signed-off-by: Dan Zhang --- test/extensions/quic_listeners/quiche/platform/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index b8e48962bc945..af11b372d9864 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -44,8 +44,8 @@ envoy_cc_test( "//test/test_common:threadsafe_singleton_injector_lib", "//test/test_common:utility_lib", "@com_googlesource_quiche//:epoll_server_lib", - "@com_googlesource_quiche//:quic_core_types_lib", "@com_googlesource_quiche//:quic_core_error_codes_lib", + "@com_googlesource_quiche//:quic_core_types_lib", "@com_googlesource_quiche//:quic_platform_expect_bug", "@com_googlesource_quiche//:quic_platform_mock_log", "@com_googlesource_quiche//:quic_platform_port_utils", From e50d1a7ba62ba8ac59dc20c69d20c63b27d8ace2 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Wed, 8 May 2019 17:24:57 -0400 Subject: [PATCH 17/29] fix deps agains Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 81356c76a826e..d1ca2f5fcc77b 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -189,7 +189,7 @@ envoy_cc_library( name = "quic_platform_sleep_impl_lib", hdrs = ["quic_sleep_impl.h"], visibility = ["//visibility:public"], - deps = ["@com_googlesource_quiche//:quic_time_lib"], + deps = ["@com_googlesource_quiche//:quic_core_time_lib"], ) envoy_cc_library( From 67ce36b264ecab82aaca05636717206716c2427d Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 9 May 2019 18:47:18 -0400 Subject: [PATCH 18/29] fix deps Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index d1ca2f5fcc77b..98bf55f99caed 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -104,7 +104,6 @@ envoy_cc_library( "quic_flag_utils_impl.h", "quic_flags_impl.h", "quic_iovec_impl.h", - "quic_logging_impl.h", "quic_map_util_impl.h", "quic_prefetch_impl.h", "quic_ptr_util_impl.h", @@ -182,7 +181,10 @@ envoy_cc_library( "abseil_node_hash_map", ], visibility = ["//visibility:public"], - deps = [":quic_platform_base_impl_lib"], + deps = [ + ":quic_platform_base_impl_lib", + ":quic_platform_logging_impl_lib", + ], ) envoy_cc_library( From a4608c3ff69c41e7579eff1871915274d65f0b2a Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Wed, 15 May 2019 18:03:55 -0400 Subject: [PATCH 19/29] add dummy .cc file Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 1 + .../quic_listeners/quiche/platform/quiche_logging_impl.cc | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 98bf55f99caed..c54d4377dc2a2 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -171,6 +171,7 @@ envoy_cc_library( envoy_cc_library( name = "quiche_common_platform_impl_lib", + srcs = ["quiche_logging_impl.cc"], hdrs = [ "quiche_logging_impl.h", "quiche_ptr_util_impl.h", diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc new file mode 100644 index 0000000000000..b90ac8c26e7d3 --- /dev/null +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc @@ -0,0 +1,8 @@ +// NOLINT(namespace-envoy) + +// This file is part of the QUICHE platform implementation, and is not to be +// consumed or referenced directly by other Envoy code. It serves purely as a +// porting layer for QUICHE. + +// Add a dummy .cc file to make sure .h file is compiled. +#include "extensions/quic_listeners/quiche/platform/quiche_logging_impl.h" From 5e2d0641bcf9900e34d54bde6c4ec5341340688a Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Fri, 17 May 2019 15:49:36 -0400 Subject: [PATCH 20/29] add dummy function to logging_impl.h Signed-off-by: Dan Zhang --- .../quic_listeners/quiche/platform/quiche_logging_impl.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h index 26e5f7662630b..3c8a71785d800 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h @@ -7,3 +7,11 @@ // porting layer for QUICHE. #include "extensions/quic_listeners/quiche/platform/quic_logging_impl.h" + +namespace quiche { + +void dummy() { + do { + } while (false); +} +} // namespace quiche From 0db82cb0ab0dd90c0a5f0cd7d64abeabbf39f8e4 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Fri, 17 May 2019 16:04:33 -0400 Subject: [PATCH 21/29] rename dummy Signed-off-by: Dan Zhang --- .../quic_listeners/quiche/platform/quiche_logging_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h index 3c8a71785d800..957cdfc3e1267 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h @@ -10,7 +10,7 @@ namespace quiche { -void dummy() { +void dummy_for_clang_tidy() { do { } while (false); } From 52a926955297778caa220e04ab5feb20458c2470 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Fri, 17 May 2019 17:18:04 -0400 Subject: [PATCH 22/29] inline dummy Signed-off-by: Dan Zhang --- .../quic_listeners/quiche/platform/quiche_logging_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h index 957cdfc3e1267..6ebf7f448c83e 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h @@ -10,7 +10,7 @@ namespace quiche { -void dummy_for_clang_tidy() { +inline void dummy_for_clang_tidy() { do { } while (false); } From 0cacc00ead1df07c6c86214af6ec5c929b3ec741 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Mon, 20 May 2019 12:15:27 -0400 Subject: [PATCH 23/29] take out quic_logging Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 11 ++++++++++- test/extensions/quic_listeners/quiche/platform/BUILD | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index b0dcc352458b8..8cca451466393 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -225,6 +225,7 @@ envoy_cc_library( deps = [ ":quic_core_time_lib", ":quic_platform_base", + ":quic_platform_logging", "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_impl_lib", ], ) @@ -300,6 +301,14 @@ envoy_cc_test_library( deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quic_platform_thread_impl_lib"], ) +envoy_cc_library( + name = "quic_platform_logging", + hdrs = ["quiche/quic/platform/api/quic_logging.h"], + repository = "@envoy", + visibility = ["//visibility:public"], + deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_logging_impl_lib"], +) + envoy_cc_library( name = "quic_platform_base", hdrs = [ @@ -315,7 +324,6 @@ envoy_cc_library( "quiche/quic/platform/api/quic_flag_utils.h", "quiche/quic/platform/api/quic_flags.h", "quiche/quic/platform/api/quic_iovec.h", - "quiche/quic/platform/api/quic_logging.h", "quiche/quic/platform/api/quic_map_util.h", "quiche/quic/platform/api/quic_prefetch.h", "quiche/quic/platform/api/quic_ptr_util.h", @@ -401,6 +409,7 @@ envoy_cc_library( ":quic_core_error_codes_lib", ":quic_core_time_lib", ":quic_platform_base", + ":quic_platform_logging", ], ) diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index af11b372d9864..638e77a78b5a2 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -117,6 +117,7 @@ envoy_cc_test_library( hdrs = ["quic_expect_bug_impl.h"], deps = [ "@com_googlesource_quiche//:quic_platform_base", + "@com_googlesource_quiche//:quic_platform_logging", "@com_googlesource_quiche//:quic_platform_mock_log", ], ) @@ -171,6 +172,7 @@ envoy_cc_test_library( deps = [ "//source/common/filesystem:filesystem_lib", "@com_googlesource_quiche//:quic_platform_base", + "@com_googlesource_quiche//:quic_platform_logging", ], ) From b15ec531d14bafba0b37ddd953b2fa55cb648497 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Mon, 20 May 2019 17:32:52 -0400 Subject: [PATCH 24/29] remove quiche_logging_impl.cc Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 1 - test/extensions/quic_listeners/quiche/platform/BUILD | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index c54d4377dc2a2..98bf55f99caed 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -171,7 +171,6 @@ envoy_cc_library( envoy_cc_library( name = "quiche_common_platform_impl_lib", - srcs = ["quiche_logging_impl.cc"], hdrs = [ "quiche_logging_impl.h", "quiche_ptr_util_impl.h", diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index 638e77a78b5a2..fd1dcc853b4a7 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -64,6 +64,7 @@ envoy_cc_test( "//source/extensions/quic_listeners/quiche/platform:flags_impl_lib", "//test/test_common:logging_lib", "//test/test_common:utility_lib", + "@com_googlesource_quiche//:spdy_platform", "@com_googlesource_quiche//:spdy_platform_test_helpers", ], ) From 60f982e7bd72032a5ba5fb806718e6b7e09e9a9a Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 21 May 2019 11:54:09 -0400 Subject: [PATCH 25/29] move quic_logging into base Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 12 ++---------- test/extensions/quic_listeners/quiche/platform/BUILD | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 8cca451466393..917ba5c8752fb 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -225,7 +225,6 @@ envoy_cc_library( deps = [ ":quic_core_time_lib", ":quic_platform_base", - ":quic_platform_logging", "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_impl_lib", ], ) @@ -301,14 +300,6 @@ envoy_cc_test_library( deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quic_platform_thread_impl_lib"], ) -envoy_cc_library( - name = "quic_platform_logging", - hdrs = ["quiche/quic/platform/api/quic_logging.h"], - repository = "@envoy", - visibility = ["//visibility:public"], - deps = ["@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_logging_impl_lib"], -) - envoy_cc_library( name = "quic_platform_base", hdrs = [ @@ -324,6 +315,7 @@ envoy_cc_library( "quiche/quic/platform/api/quic_flag_utils.h", "quiche/quic/platform/api/quic_flags.h", "quiche/quic/platform/api/quic_iovec.h", + "quiche/quic/platform/api/quic_logging.h", "quiche/quic/platform/api/quic_map_util.h", "quiche/quic/platform/api/quic_prefetch.h", "quiche/quic/platform/api/quic_ptr_util.h", @@ -352,6 +344,7 @@ envoy_cc_library( deps = [ ":quic_platform_export", ":quiche_common_lib", + "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_logging_impl_lib", "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_base_impl_lib", ], ) @@ -409,7 +402,6 @@ envoy_cc_library( ":quic_core_error_codes_lib", ":quic_core_time_lib", ":quic_platform_base", - ":quic_platform_logging", ], ) diff --git a/test/extensions/quic_listeners/quiche/platform/BUILD b/test/extensions/quic_listeners/quiche/platform/BUILD index fd1dcc853b4a7..ba5156ac0bd37 100644 --- a/test/extensions/quic_listeners/quiche/platform/BUILD +++ b/test/extensions/quic_listeners/quiche/platform/BUILD @@ -118,7 +118,6 @@ envoy_cc_test_library( hdrs = ["quic_expect_bug_impl.h"], deps = [ "@com_googlesource_quiche//:quic_platform_base", - "@com_googlesource_quiche//:quic_platform_logging", "@com_googlesource_quiche//:quic_platform_mock_log", ], ) @@ -173,7 +172,6 @@ envoy_cc_test_library( deps = [ "//source/common/filesystem:filesystem_lib", "@com_googlesource_quiche//:quic_platform_base", - "@com_googlesource_quiche//:quic_platform_logging", ], ) From b6056c282023c45fccc6bbff8b56e30eb61d966c Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 21 May 2019 13:47:00 -0400 Subject: [PATCH 26/29] break circular deps Signed-off-by: Dan Zhang --- source/extensions/quic_listeners/quiche/platform/BUILD | 3 +-- .../quic_listeners/quiche/platform/quiche_logging_impl.cc | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc diff --git a/source/extensions/quic_listeners/quiche/platform/BUILD b/source/extensions/quic_listeners/quiche/platform/BUILD index 98bf55f99caed..e347bac4cfbf1 100644 --- a/source/extensions/quic_listeners/quiche/platform/BUILD +++ b/source/extensions/quic_listeners/quiche/platform/BUILD @@ -128,13 +128,13 @@ envoy_cc_library( visibility = ["//visibility:public"], deps = [ ":flags_impl_lib", - ":quic_platform_logging_impl_lib", ":string_utils_lib", "//source/common/common:assert_lib", "//source/common/common:byte_order_lib", "//source/server:backtrace_lib", "@com_googlesource_quiche//:quic_core_buffer_allocator_lib", "@com_googlesource_quiche//:quic_platform_export", + "@com_googlesource_quiche//:quiche_common_platform", ], ) @@ -182,7 +182,6 @@ envoy_cc_library( ], visibility = ["//visibility:public"], deps = [ - ":quic_platform_base_impl_lib", ":quic_platform_logging_impl_lib", ], ) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc deleted file mode 100644 index b90ac8c26e7d3..0000000000000 --- a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.cc +++ /dev/null @@ -1,8 +0,0 @@ -// NOLINT(namespace-envoy) - -// This file is part of the QUICHE platform implementation, and is not to be -// consumed or referenced directly by other Envoy code. It serves purely as a -// porting layer for QUICHE. - -// Add a dummy .cc file to make sure .h file is compiled. -#include "extensions/quic_listeners/quiche/platform/quiche_logging_impl.h" From 5bcde48304443d4df83edba812e8d169ea9916fd Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 21 May 2019 13:54:26 -0400 Subject: [PATCH 27/29] format Signed-off-by: Dan Zhang --- bazel/external/quiche.BUILD | 4 ++-- .../quic_listeners/quiche/platform/quiche_logging_impl.h | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index 917ba5c8752fb..cc12b3392bd0a 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -315,7 +315,7 @@ envoy_cc_library( "quiche/quic/platform/api/quic_flag_utils.h", "quiche/quic/platform/api/quic_flags.h", "quiche/quic/platform/api/quic_iovec.h", - "quiche/quic/platform/api/quic_logging.h", + "quiche/quic/platform/api/quic_logging.h", "quiche/quic/platform/api/quic_map_util.h", "quiche/quic/platform/api/quic_prefetch.h", "quiche/quic/platform/api/quic_ptr_util.h", @@ -344,8 +344,8 @@ envoy_cc_library( deps = [ ":quic_platform_export", ":quiche_common_lib", - "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_logging_impl_lib", "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_base_impl_lib", + "@envoy//source/extensions/quic_listeners/quiche/platform:quic_platform_logging_impl_lib", ], ) diff --git a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h index 6ebf7f448c83e..26e5f7662630b 100644 --- a/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/quiche_logging_impl.h @@ -7,11 +7,3 @@ // porting layer for QUICHE. #include "extensions/quic_listeners/quiche/platform/quic_logging_impl.h" - -namespace quiche { - -inline void dummy_for_clang_tidy() { - do { - } while (false); -} -} // namespace quiche From 09f9f7a1d80e47a3154e380bf63b2795c938dce8 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 21 May 2019 16:59:56 -0400 Subject: [PATCH 28/29] remove out-dated comment Signed-off-by: Dan Zhang --- .../quic_listeners/quiche/platform/spdy_containers_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h index 05f5febcc06b6..ff114a0f76101 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h @@ -10,10 +10,6 @@ #include "absl/container/flat_hash_set.h" #include "absl/container/inlined_vector.h" #include "absl/hash/hash.h" - -// -// However, for some reason, bazel.clang_tidy cannot resolve the files when specified this way. - #include "extensions/quic_listeners/quiche/platform/spdy_string_impl.h" #include "extensions/quic_listeners/quiche/platform/spdy_string_piece_impl.h" #include "quiche/common/simple_linked_hash_map.h" From 792282db760ffca740e12f27e5df6f1c1998ac07 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Tue, 21 May 2019 17:42:17 -0400 Subject: [PATCH 29/29] format Signed-off-by: Dan Zhang --- .../quic_listeners/quiche/platform/spdy_containers_impl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h index ff114a0f76101..57d953c939d37 100644 --- a/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h +++ b/source/extensions/quic_listeners/quiche/platform/spdy_containers_impl.h @@ -6,12 +6,13 @@ // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. +#include "extensions/quic_listeners/quiche/platform/spdy_string_impl.h" +#include "extensions/quic_listeners/quiche/platform/spdy_string_piece_impl.h" + #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" #include "absl/container/inlined_vector.h" #include "absl/hash/hash.h" -#include "extensions/quic_listeners/quiche/platform/spdy_string_impl.h" -#include "extensions/quic_listeners/quiche/platform/spdy_string_piece_impl.h" #include "quiche/common/simple_linked_hash_map.h" namespace spdy {