|  | @@ -49,14 +49,18 @@
 | 
	
		
			
				|  |  |  #include "src/core/lib/profiling/timers.h"
 | 
	
		
			
				|  |  |  #include "src/core/lib/surface/completion_queue.h"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -namespace grpc {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -static internal::GrpcLibraryInitializer g_gli_initializer;
 | 
	
		
			
				|  |  | -Channel::Channel(
 | 
	
		
			
				|  |  | -    const grpc::string& host, grpc_channel* channel,
 | 
	
		
			
				|  |  | -    std::vector<
 | 
	
		
			
				|  |  | -        std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>
 | 
	
		
			
				|  |  | -        interceptor_creators)
 | 
	
		
			
				|  |  | +void grpc::experimental::ChannelResetConnectionBackoff(
 | 
	
		
			
				|  |  | +    ::grpc::Channel* channel) {
 | 
	
		
			
				|  |  | +  grpc_impl::experimental::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)
 | 
	
		
			
				|  |  |      : host_(host), c_channel_(channel) {
 | 
	
		
			
				|  |  |    interceptor_creators_ = std::move(interceptor_creators);
 | 
	
		
			
				|  |  |    g_gli_initializer.summon();
 | 
	
	
		
			
				|  | @@ -72,7 +76,8 @@ Channel::~Channel() {
 | 
	
		
			
				|  |  |  namespace {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  inline grpc_slice SliceFromArray(const char* arr, size_t len) {
 | 
	
		
			
				|  |  | -  return 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,
 | 
	
	
		
			
				|  | @@ -110,10 +115,9 @@ void ChannelResetConnectionBackoff(Channel* channel) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }  // namespace experimental
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -internal::Call Channel::CreateCallInternal(const internal::RpcMethod& method,
 | 
	
		
			
				|  |  | -                                           ClientContext* context,
 | 
	
		
			
				|  |  | -                                           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) {
 | 
	
	
		
			
				|  | @@ -122,7 +126,7 @@ internal::Call Channel::CreateCallInternal(const internal::RpcMethod& method,
 | 
	
		
			
				|  |  |          context->propagation_options_.c_bitmask(), cq->cq(),
 | 
	
		
			
				|  |  |          method.channel_tag(), context->raw_deadline(), nullptr);
 | 
	
		
			
				|  |  |    } else {
 | 
	
		
			
				|  |  | -    const string* host_str = nullptr;
 | 
	
		
			
				|  |  | +    const ::grpc::string* host_str = nullptr;
 | 
	
		
			
				|  |  |      if (!context->authority_.empty()) {
 | 
	
		
			
				|  |  |        host_str = &context->authority_;
 | 
	
		
			
				|  |  |      } else if (!host_.empty()) {
 | 
	
	
		
			
				|  | @@ -132,7 +136,7 @@ internal::Call Channel::CreateCallInternal(const internal::RpcMethod& method,
 | 
	
		
			
				|  |  |          SliceFromArray(method.name(), strlen(method.name()));
 | 
	
		
			
				|  |  |      grpc_slice host_slice;
 | 
	
		
			
				|  |  |      if (host_str != nullptr) {
 | 
	
		
			
				|  |  | -      host_slice = SliceFromCopiedString(*host_str);
 | 
	
		
			
				|  |  | +      host_slice = ::grpc::SliceFromCopiedString(*host_str);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      c_call = grpc_channel_create_call(
 | 
	
		
			
				|  |  |          c_channel_, context->propagate_from_call_,
 | 
	
	
		
			
				|  | @@ -154,17 +158,17 @@ internal::Call Channel::CreateCallInternal(const internal::RpcMethod& method,
 | 
	
		
			
				|  |  |                                     interceptor_creators_, interceptor_pos);
 | 
	
		
			
				|  |  |    context->set_call(c_call, shared_from_this());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  return internal::Call(c_call, this, cq, info);
 | 
	
		
			
				|  |  | +  return ::grpc::internal::Call(c_call, this, cq, info);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -internal::Call Channel::CreateCall(const internal::RpcMethod& method,
 | 
	
		
			
				|  |  | -                                   ClientContext* context,
 | 
	
		
			
				|  |  | -                                   CompletionQueue* cq) {
 | 
	
		
			
				|  |  | +::grpc::internal::Call Channel::CreateCall(
 | 
	
		
			
				|  |  | +    const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
 | 
	
		
			
				|  |  | +    ::grpc::CompletionQueue* cq) {
 | 
	
		
			
				|  |  |    return CreateCallInternal(method, context, cq, 0);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -void Channel::PerformOpsOnCall(internal::CallOpSetInterface* ops,
 | 
	
		
			
				|  |  | -                               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
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -180,7 +184,7 @@ grpc_connectivity_state Channel::GetState(bool try_to_connect) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  namespace {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -class TagSaver final : public internal::CompletionQueueTag {
 | 
	
		
			
				|  |  | +class TagSaver final : public ::grpc::internal::CompletionQueueTag {
 | 
	
		
			
				|  |  |   public:
 | 
	
		
			
				|  |  |    explicit TagSaver(void* tag) : tag_(tag) {}
 | 
	
		
			
				|  |  |    ~TagSaver() override {}
 | 
	
	
		
			
				|  | @@ -198,7 +202,7 @@ class TagSaver final : public internal::CompletionQueueTag {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
 | 
	
		
			
				|  |  |                                        gpr_timespec deadline,
 | 
	
		
			
				|  |  | -                                      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);
 | 
	
	
		
			
				|  | @@ -206,7 +210,7 @@ void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
 | 
	
		
			
				|  |  |                                       gpr_timespec deadline) {
 | 
	
		
			
				|  |  | -  CompletionQueue cq;
 | 
	
		
			
				|  |  | +  ::grpc::CompletionQueue cq;
 | 
	
		
			
				|  |  |    bool ok = false;
 | 
	
		
			
				|  |  |    void* tag = nullptr;
 | 
	
		
			
				|  |  |    NotifyOnStateChangeImpl(last_observed, deadline, &cq, nullptr);
 | 
	
	
		
			
				|  | @@ -221,7 +225,7 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
 | 
	
		
			
				|  |  |    ShutdownCallback() { functor_run = &ShutdownCallback::Run; }
 | 
	
		
			
				|  |  |    // TakeCQ takes ownership of the cq into the shutdown callback
 | 
	
		
			
				|  |  |    // so that the shutdown callback will be responsible for destroying it
 | 
	
		
			
				|  |  | -  void TakeCQ(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
 | 
	
	
		
			
				|  | @@ -232,17 +236,17 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |   private:
 | 
	
		
			
				|  |  | -  CompletionQueue* cq_ = nullptr;
 | 
	
		
			
				|  |  | +  ::grpc::CompletionQueue* cq_ = nullptr;
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  }  // namespace
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -CompletionQueue* Channel::CallbackCQ() {
 | 
	
		
			
				|  |  | +::grpc::CompletionQueue* Channel::CallbackCQ() {
 | 
	
		
			
				|  |  |    // TODO(vjpai): Consider using a single global CQ for the default CQ
 | 
	
		
			
				|  |  |    // if there is no explicit per-channel CQ registered
 | 
	
		
			
				|  |  |    std::lock_guard<std::mutex> l(mu_);
 | 
	
		
			
				|  |  |    if (callback_cq_ == nullptr) {
 | 
	
		
			
				|  |  |      auto* shutdown_callback = new ShutdownCallback;
 | 
	
		
			
				|  |  | -    callback_cq_ = new CompletionQueue(grpc_completion_queue_attributes{
 | 
	
		
			
				|  |  | +    callback_cq_ = new ::grpc::CompletionQueue(grpc_completion_queue_attributes{
 | 
	
		
			
				|  |  |          GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING,
 | 
	
		
			
				|  |  |          shutdown_callback});
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -252,4 +256,4 @@ CompletionQueue* Channel::CallbackCQ() {
 | 
	
		
			
				|  |  |    return callback_cq_;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -}  // namespace grpc
 | 
	
		
			
				|  |  | +}  // namespace grpc_impl
 |