#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"
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 = …;
}
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) { … }
}
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() { … }
}
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) { … }
}
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) { … }