chromium/third_party/grpc/src/src/core/lib/surface/channel.cc

//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#include <grpc/support/port_platform.h>

#include "src/core/lib/surface/channel.h"

#include <inttypes.h>
#include <string.h>

#include <algorithm>
#include <atomic>
#include <functional>
#include <memory>

#include "absl/status/status.h"

#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>

#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/init_internally.h"
#include "src/core/lib/transport/transport.h"

// IWYU pragma: no_include <type_traits>

namespace grpc_core {

Channel::Channel(bool is_client, bool is_promising, std::string target,
                 const ChannelArgs& channel_args,
                 grpc_compression_options compression_options,
                 RefCountedPtr<grpc_channel_stack> channel_stack)
    :{}

absl::StatusOr<RefCountedPtr<Channel>> Channel::CreateWithBuilder(
    ChannelStackBuilder* builder) {}

namespace {

void* channelz_node_copy(void* p) {}
void channelz_node_destroy(void* p) {}
int channelz_node_cmp(void* p1, void* p2) {}
const grpc_arg_pointer_vtable channelz_node_arg_vtable =;
}  // namespace

absl::StatusOr<RefCountedPtr<Channel>> Channel::Create(
    const char* target, ChannelArgs args,
    grpc_channel_stack_type channel_stack_type,
    grpc_transport* optional_transport) {}

void Channel::UpdateCallSizeEstimate(size_t size) {}

}  // namespace grpc_core

char* grpc_channel_get_target(grpc_channel* channel) {}

void grpc_channel_get_info(grpc_channel* channel,
                           const grpc_channel_info* channel_info) {}

void grpc_channel_reset_connect_backoff(grpc_channel* channel) {}

static grpc_call* grpc_channel_create_call_internal(
    grpc_channel* c_channel, grpc_call* parent_call, uint32_t propagation_mask,
    grpc_completion_queue* cq, grpc_pollset_set* pollset_set_alternative,
    grpc_core::Slice path, absl::optional<grpc_core::Slice> authority,
    grpc_core::Timestamp deadline) {}

grpc_call* grpc_channel_create_call(grpc_channel* channel,
                                    grpc_call* parent_call,
                                    uint32_t propagation_mask,
                                    grpc_completion_queue* completion_queue,
                                    grpc_slice method, const grpc_slice* host,
                                    gpr_timespec deadline, void* reserved) {}

grpc_call* grpc_channel_create_pollset_set_call(
    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
    grpc_pollset_set* pollset_set, const grpc_slice& method,
    const grpc_slice* host, grpc_core::Timestamp deadline, void* reserved) {}

namespace grpc_core {

RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg) {}

RegisteredCall::RegisteredCall(const RegisteredCall& other)
    :{}

RegisteredCall::~RegisteredCall() {}

}  // namespace grpc_core

void* grpc_channel_register_call(grpc_channel* channel, const char* method,
                                 const char* host, void* reserved) {}

namespace grpc_core {

RegisteredCall* Channel::RegisterCall(const char* method, const char* host) {}

}  // namespace grpc_core

grpc_call* grpc_channel_create_registered_call(
    grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
    grpc_completion_queue* completion_queue, void* registered_call_handle,
    gpr_timespec deadline, void* reserved) {}

void grpc_channel_destroy_internal(grpc_channel* c_channel) {}

void grpc_channel_destroy(grpc_channel* channel) {}