diff options
Diffstat (limited to 'src/cpp/client/channel_cc.cc')
-rw-r--r-- | src/cpp/client/channel_cc.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index e4aa072db0..1702dc5642 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -44,12 +44,11 @@ namespace grpc { -static grpc::internal::GrpcLibraryInitializer g_gli_initializer; -Channel::Channel( - const std::string& host, grpc_channel* channel, - std::vector< - std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>> - interceptor_creators) +static ::grpc::internal::GrpcLibraryInitializer g_gli_initializer; +Channel::Channel(const std::string& host, grpc_channel* channel, + std::vector<std::unique_ptr< + ::grpc::experimental::ClientInterceptorFactoryInterface>> + interceptor_creators) : host_(host), c_channel_(channel) { interceptor_creators_ = std::move(interceptor_creators); g_gli_initializer.summon(); @@ -109,9 +108,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) { @@ -130,7 +129,7 @@ grpc::internal::Call Channel::CreateCallInternal( SliceFromArray(method.name(), strlen(method.name())); grpc_slice host_slice; if (host_str != nullptr) { - host_slice = grpc::SliceFromCopiedString(*host_str); + host_slice = ::grpc::SliceFromCopiedString(*host_str); } c_call = grpc_channel_create_call( c_channel_, context->propagate_from_call_, @@ -152,17 +151,17 @@ grpc::internal::Call Channel::CreateCallInternal( interceptor_creators_, interceptor_pos); context->set_call(c_call, shared_from_this()); - return grpc::internal::Call(c_call, this, cq, info); + return ::grpc::internal::Call(c_call, this, cq, info); } -grpc::internal::Call Channel::CreateCall( - const grpc::internal::RpcMethod& method, grpc::ClientContext* context, +::grpc::internal::Call Channel::CreateCall( + const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, CompletionQueue* cq) { return CreateCallInternal(method, context, cq, 0); } -void Channel::PerformOpsOnCall(grpc::internal::CallOpSetInterface* ops, - grpc::internal::Call* call) { +void Channel::PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops, + ::grpc::internal::Call* call) { ops->FillOps( call); // Make a copy of call. It's fine since Call just has pointers } @@ -178,7 +177,7 @@ grpc_connectivity_state Channel::GetState(bool try_to_connect) { namespace { -class TagSaver final : public grpc::internal::CompletionQueueTag { +class TagSaver final : public ::grpc::internal::CompletionQueueTag { public: explicit TagSaver(void* tag) : tag_(tag) {} ~TagSaver() override {} @@ -196,7 +195,7 @@ class TagSaver final : public grpc::internal::CompletionQueueTag { void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline, - grpc::CompletionQueue* cq, void* tag) { + ::grpc::CompletionQueue* cq, void* tag) { TagSaver* tag_saver = new TagSaver(tag); grpc_channel_watch_connectivity_state(c_channel_, last_observed, deadline, cq->cq(), tag_saver); @@ -204,7 +203,7 @@ void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline) { - grpc::CompletionQueue cq; + ::grpc::CompletionQueue cq; bool ok = false; void* tag = nullptr; NotifyOnStateChangeImpl(last_observed, deadline, &cq, nullptr); @@ -226,7 +225,7 @@ class ShutdownCallback : public grpc_completion_queue_functor { } // TakeCQ takes ownership of the cq into the shutdown callback // so that the shutdown callback will be responsible for destroying it - void TakeCQ(grpc::CompletionQueue* cq) { cq_ = cq; } + void TakeCQ(::grpc::CompletionQueue* cq) { cq_ = cq; } // The Run function will get invoked by the completion queue library // when the shutdown is actually complete @@ -237,7 +236,7 @@ class ShutdownCallback : public grpc_completion_queue_functor { } private: - grpc::CompletionQueue* cq_ = nullptr; + ::grpc::CompletionQueue* cq_ = nullptr; }; } // namespace @@ -257,9 +256,10 @@ class ShutdownCallback : public grpc_completion_queue_functor { // gRPC-core provides the backing needed for the preferred CQ type auto* shutdown_callback = new ShutdownCallback; - callback_cq = new grpc::CompletionQueue(grpc_completion_queue_attributes{ - GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING, - shutdown_callback}); + callback_cq = + new ::grpc::CompletionQueue(grpc_completion_queue_attributes{ + GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, + GRPC_CQ_DEFAULT_POLLING, shutdown_callback}); // Transfer ownership of the new cq to its own shutdown callback shutdown_callback->TakeCQ(callback_cq); |