diff --git a/include/grpcpp/channel_impl.h b/include/grpcpp/channel_impl.h index 19198655e99..ea90e5b8f7b 100644 --- a/include/grpcpp/channel_impl.h +++ b/include/grpcpp/channel_impl.h @@ -65,33 +65,33 @@ class Channel final : public ::grpc::ChannelInterface, friend void experimental::ChannelResetConnectionBackoff(Channel* channel); friend std::shared_ptr CreateChannelInternal( const grpc::string& host, grpc_channel* c_channel, - std::vector< - std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> + std::vector> interceptor_creators); friend class ::grpc::internal::InterceptedChannel; Channel(const grpc::string& host, grpc_channel* c_channel, - std::vector< - std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> + std::vector> interceptor_creators); ::grpc::internal::Call CreateCall(const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, - ::grpc::CompletionQueue* cq) override; + ::grpc::ClientContext* context, + ::grpc::CompletionQueue* cq) override; void PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops, ::grpc::internal::Call* call) override; void* RegisterMethod(const char* method) override; void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, - gpr_timespec deadline, ::grpc::CompletionQueue* cq, - void* tag) override; + gpr_timespec deadline, + ::grpc::CompletionQueue* cq, void* tag) override; bool WaitForStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline) override; ::grpc::CompletionQueue* CallbackCQ() override; - ::grpc::internal::Call CreateCallInternal(const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, - size_t interceptor_pos) override; + ::grpc::internal::Call CreateCallInternal( + const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + ::grpc::CompletionQueue* cq, size_t interceptor_pos) override; const grpc::string host_; grpc_channel* const c_channel_; // owned @@ -105,10 +105,11 @@ class Channel final : public ::grpc::ChannelInterface, // shutdown callback tag (invoked when the CQ is fully shutdown). ::grpc::CompletionQueue* callback_cq_ = nullptr; - std::vector> + std::vector< + std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> interceptor_creators_; }; -} // namespace grpc +} // namespace grpc_impl -#endif // GRPCPP_CHANNEL_H +#endif // GRPCPP_CHANNEL_IMPL_H diff --git a/include/grpcpp/impl/codegen/client_context.h b/include/grpcpp/impl/codegen/client_context.h index edb583542dd..e6579b5b7a7 100644 --- a/include/grpcpp/impl/codegen/client_context.h +++ b/include/grpcpp/impl/codegen/client_context.h @@ -59,7 +59,6 @@ struct grpc_call; namespace grpc_impl { class Channel; - } namespace grpc { @@ -428,7 +427,8 @@ class ClientContext { } grpc_call* call() const { return call_; } - void set_call(grpc_call* call, const std::shared_ptr<::grpc_impl::Channel>& channel); + void set_call(grpc_call* call, + const std::shared_ptr<::grpc_impl::Channel>& channel); experimental::ClientRpcInfo* set_client_rpc_info( const char* method, internal::RpcMethod::RpcType type, diff --git a/include/grpcpp/impl/codegen/client_interceptor.h b/include/grpcpp/impl/codegen/client_interceptor.h index 3e8eced6391..c3bdf2364f0 100644 --- a/include/grpcpp/impl/codegen/client_interceptor.h +++ b/include/grpcpp/impl/codegen/client_interceptor.h @@ -29,7 +29,6 @@ namespace grpc_impl { class Channel; - } namespace grpc { diff --git a/include/grpcpp/impl/codegen/completion_queue.h b/include/grpcpp/impl/codegen/completion_queue.h index 7493aa8ba49..96790eca534 100644 --- a/include/grpcpp/impl/codegen/completion_queue.h +++ b/include/grpcpp/impl/codegen/completion_queue.h @@ -44,7 +44,6 @@ struct grpc_completion_queue; namespace grpc_impl { class Channel; - } namespace grpc { diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index 551d9d1576f..8f090da070f 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -35,7 +35,6 @@ struct grpc_call; namespace grpc_impl { class Channel; - } namespace grpc { diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index 9724dcad08d..182eb2115bc 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -49,18 +49,18 @@ #include "src/core/lib/profiling/timers.h" #include "src/core/lib/surface/completion_queue.h" -void grpc::experimental::ChannelResetConnectionBackoff(::grpc::Channel* channel) { +void grpc::experimental::ChannelResetConnectionBackoff( + ::grpc::Channel* channel) { ChannelResetConnectionBackoff(channel); } namespace grpc_impl { static ::grpc::internal::GrpcLibraryInitializer g_gli_initializer; -Channel::Channel( - const grpc::string& host, grpc_channel* channel, - std::vector< - std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> - interceptor_creators) +Channel::Channel(const grpc::string& host, grpc_channel* channel, + std::vector> + interceptor_creators) : host_(host), c_channel_(channel) { interceptor_creators_ = std::move(interceptor_creators); g_gli_initializer.summon(); @@ -76,7 +76,8 @@ Channel::~Channel() { namespace { inline grpc_slice SliceFromArray(const char* arr, size_t len) { - return ::grpc::g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, len); + return ::grpc::g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, + len); } grpc::string GetChannelInfoField(grpc_channel* channel, @@ -114,10 +115,9 @@ void ChannelResetConnectionBackoff(Channel* channel) { } // namespace experimental -::grpc::internal::Call Channel::CreateCallInternal(const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, - ::grpc::CompletionQueue* cq, - size_t interceptor_pos) { +::grpc::internal::Call Channel::CreateCallInternal( + const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + ::grpc::CompletionQueue* cq, size_t interceptor_pos) { const bool kRegistered = method.channel_tag() && context->authority().empty(); grpc_call* c_call = nullptr; if (kRegistered) { @@ -161,9 +161,9 @@ void ChannelResetConnectionBackoff(Channel* channel) { return ::grpc::internal::Call(c_call, this, cq, info); } -::grpc::internal::Call Channel::CreateCall(const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, - ::grpc::CompletionQueue* cq) { +::grpc::internal::Call Channel::CreateCall( + const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + ::grpc::CompletionQueue* cq) { return CreateCallInternal(method, context, cq, 0); } @@ -256,4 +256,4 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor { return callback_cq_; } -} // namespace grpc +} // namespace grpc_impl diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index c30011c2625..b3c52acd5f6 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -33,7 +33,6 @@ namespace grpc_impl { class Channel; - } namespace grpc { @@ -88,8 +87,8 @@ void ClientContext::AddMetadata(const grpc::string& meta_key, send_initial_metadata_.insert(std::make_pair(meta_key, meta_value)); } -void ClientContext::set_call(grpc_call* call, - const std::shared_ptr<::grpc_impl::Channel>& channel) { +void ClientContext::set_call( + grpc_call* call, const std::shared_ptr<::grpc_impl::Channel>& channel) { std::unique_lock lock(mu_); GPR_ASSERT(call_ == nullptr); call_ = call; diff --git a/src/cpp/client/create_channel_internal.cc b/src/cpp/client/create_channel_internal.cc index 1aceee9d37b..77fd00fb3fe 100644 --- a/src/cpp/client/create_channel_internal.cc +++ b/src/cpp/client/create_channel_internal.cc @@ -26,11 +26,11 @@ namespace grpc_impl { std::shared_ptr CreateChannelInternal( const grpc::string& host, grpc_channel* c_channel, - std::vector< - std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> + std::vector> interceptor_creators) { return std::shared_ptr( new Channel(host, c_channel, std::move(interceptor_creators))); } -} +} // namespace grpc_impl diff --git a/src/cpp/client/create_channel_internal.h b/src/cpp/client/create_channel_internal.h index caa8c5363fb..7dab6473a9c 100644 --- a/src/cpp/client/create_channel_internal.h +++ b/src/cpp/client/create_channel_internal.h @@ -32,10 +32,10 @@ class Channel; std::shared_ptr CreateChannelInternal( const grpc::string& host, grpc_channel* c_channel, - std::vector< - std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>> + std::vector> interceptor_creators); -} // namespace grpc +} // namespace grpc_impl #endif // GRPC_INTERNAL_CPP_CLIENT_CREATE_CHANNEL_INTERNAL_H diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index 04ef0b5e617..5db4af143b4 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -30,7 +30,6 @@ namespace grpc_impl { class Channel; - } namespace grpc { diff --git a/test/cpp/util/create_test_channel.h b/test/cpp/util/create_test_channel.h index 9e8169f3304..f94f0ac30a2 100644 --- a/test/cpp/util/create_test_channel.h +++ b/test/cpp/util/create_test_channel.h @@ -26,7 +26,6 @@ namespace grpc_impl { class Channel; - } namespace grpc {