From 5f9d79c73aba2728202d737c607c1feb3b74b56e Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 25 Nov 2020 18:40:13 -0800 Subject: [PATCH 1/2] Enable google-build-using-namespace --- .clang-tidy | 1 - 1 file changed, 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index a9aaec4b5ab..7e38d4822e5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -10,7 +10,6 @@ Checks: '-*, -performance-unnecessary-copy-initialization, -performance-unnecessary-value-param, google-*, - -google-build-using-namespace, -google-explicit-constructor, -google-readability-casting, -google-runtime-int, From 3aba567746bd76658cca767c8a227fb6d42fa654 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 25 Nov 2020 19:48:21 -0800 Subject: [PATCH 2/2] Fix google-build-using-namespace --- .../ext/filters/client_channel/http_connect_handshaker.cc | 7 +++---- src/core/lib/channel/handshaker.cc | 4 ++-- test/core/handshake/readahead_handshaker_server_ssl.cc | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc index 1b9817cee78..979248e279f 100644 --- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc +++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc @@ -382,8 +382,7 @@ class HttpConnectHandshakerFactory : public HandshakerFactory { } // namespace grpc_core void grpc_http_connect_register_handshaker_factory() { - using namespace grpc_core; - HandshakerRegistry::RegisterHandshakerFactory( - true /* at_start */, HANDSHAKER_CLIENT, - absl::make_unique()); + grpc_core::HandshakerRegistry::RegisterHandshakerFactory( + true /* at_start */, grpc_core::HANDSHAKER_CLIENT, + absl::make_unique()); } diff --git a/src/core/lib/channel/handshaker.cc b/src/core/lib/channel/handshaker.cc index 461a21db32f..8d1d45e5623 100644 --- a/src/core/lib/channel/handshaker.cc +++ b/src/core/lib/channel/handshaker.cc @@ -256,7 +256,7 @@ void HandshakeManager::DoHandshake(grpc_endpoint* endpoint, void grpc_handshake_manager_add(grpc_handshake_manager* mgr, grpc_handshaker* handshaker) { // This is a transition method to aid the API change for handshakers. - using namespace grpc_core; - RefCountedPtr refd_hs(static_cast(handshaker)); + grpc_core::RefCountedPtr refd_hs( + static_cast(handshaker)); mgr->Add(refd_hs); } diff --git a/test/core/handshake/readahead_handshaker_server_ssl.cc b/test/core/handshake/readahead_handshaker_server_ssl.cc index c1468503e7b..708b316e793 100644 --- a/test/core/handshake/readahead_handshaker_server_ssl.cc +++ b/test/core/handshake/readahead_handshaker_server_ssl.cc @@ -77,11 +77,10 @@ class ReadAheadHandshakerFactory : public HandshakerFactory { } // namespace grpc_core int main(int /*argc*/, char* /*argv*/[]) { - using namespace grpc_core; grpc_init(); - HandshakerRegistry::RegisterHandshakerFactory( - true /* at_start */, HANDSHAKER_SERVER, - absl::make_unique()); + grpc_core::HandshakerRegistry::RegisterHandshakerFactory( + true /* at_start */, grpc_core::HANDSHAKER_SERVER, + absl::make_unique()); const char* full_alpn_list[] = {"grpc-exp", "h2"}; GPR_ASSERT(server_ssl_test(full_alpn_list, 2, "grpc-exp")); grpc_shutdown();