diff --git a/BUILD b/BUILD
index dd7046fbc4e..617bc1cf533 100644
--- a/BUILD
+++ b/BUILD
@@ -554,6 +554,7 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
+ "api_trace",
"channel_arg_names",
"channel_stack_builder",
"config",
@@ -567,6 +568,7 @@ grpc_cc_library(
"grpc_trace",
"http_connect_handshaker",
"iomgr_timer",
+ "server",
"//src/core:channel_args",
"//src/core:channel_init",
"//src/core:channel_stack_type",
@@ -578,6 +580,7 @@ grpc_cc_library(
"//src/core:http_proxy_mapper",
"//src/core:init_internally",
"//src/core:posix_event_engine_timer_manager",
+ "//src/core:server_call_tracer_filter",
"//src/core:service_config_channel_arg_filter",
"//src/core:slice",
"//src/core:tcp_connect_handshaker",
@@ -629,6 +632,7 @@ grpc_cc_library(
"@grpc:public",
],
deps = [
+ "api_trace",
"channel_arg_names",
"channel_stack_builder",
"config",
@@ -649,6 +653,7 @@ grpc_cc_library(
"iomgr_timer",
"promise",
"ref_counted_ptr",
+ "server",
"sockaddr_utils",
"tsi_base",
"uri_parser",
@@ -676,6 +681,7 @@ grpc_cc_library(
"//src/core:json",
"//src/core:posix_event_engine_timer_manager",
"//src/core:ref_counted",
+ "//src/core:server_call_tracer_filter",
"//src/core:service_config_channel_arg_filter",
"//src/core:slice",
"//src/core:slice_refcount",
@@ -1101,6 +1107,9 @@ grpc_cc_library(
],
tags = ["nofixdeps"],
deps = [
+ "api_trace",
+ "channel",
+ "channel_create",
"config",
"debug_location",
"exec_ctx",
@@ -1113,6 +1122,7 @@ grpc_cc_library(
"grpc_public_hdrs",
"orphanable",
"ref_counted_ptr",
+ "server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_args_preconditioning",
@@ -1251,6 +1261,7 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
+ "api_trace",
"gpr",
"grpc_base",
"grpc_public_hdrs",
@@ -1405,6 +1416,21 @@ grpc_cc_library(
],
)
+grpc_cc_library(
+ name = "api_trace",
+ srcs = [
+ "//src/core:lib/surface/api_trace.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/surface/api_trace.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr",
+ "grpc_trace",
+ ],
+)
+
grpc_cc_library(
name = "byte_buffer",
srcs = [
@@ -1416,6 +1442,7 @@ grpc_cc_library(
"exec_ctx",
"gpr_public_hdrs",
"grpc_public_hdrs",
+ "//src/core:compression",
"//src/core:slice",
],
)
@@ -1626,31 +1653,253 @@ grpc_cc_library(
)
grpc_cc_library(
- name = "grpc_base",
+ name = "call_tracer",
srcs = [
"//src/core:lib/channel/call_tracer.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/channel/call_tracer.h",
+ ],
+ external_deps = [
+ "absl/status",
+ "absl/strings",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "config",
+ "gpr",
+ "legacy_context",
+ "tcp_tracer",
+ "//src/core:arena",
+ "//src/core:call_final_info",
+ "//src/core:channel_args",
+ "//src/core:context",
+ "//src/core:error",
+ "//src/core:metadata_batch",
+ "//src/core:slice_buffer",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel",
+ srcs = [
+ "//src/core:lib/surface/channel.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/surface/channel.h",
+ ],
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/status:statusor",
+ "absl/strings",
+ "absl/types:optional",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "api_trace",
+ "channel_arg_names",
+ "channelz",
+ "cpp_impl_of",
+ "event_engine_base_hdrs",
+ "exec_ctx",
+ "gpr",
+ "grpc_public_hdrs",
+ "grpc_trace",
+ "orphanable",
+ "ref_counted_ptr",
+ "stats",
+ "//src/core:arena",
+ "//src/core:channel_args",
+ "//src/core:channel_stack_type",
+ "//src/core:compression",
+ "//src/core:connectivity_state",
+ "//src/core:iomgr_fwd",
+ "//src/core:ref_counted",
+ "//src/core:slice",
+ "//src/core:stats_data",
+ "//src/core:time",
+ ],
+)
+
+grpc_cc_library(
+ name = "legacy_channel",
+ srcs = [
+ "//src/core:lib/surface/legacy_channel.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/surface/legacy_channel.h",
+ ],
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/status",
+ "absl/status:statusor",
+ "absl/types:optional",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "api_trace",
+ "channel",
+ "channelz",
+ "config",
+ "exec_ctx",
+ "gpr",
+ "grpc_base",
+ "grpc_client_channel",
+ "ref_counted_ptr",
+ "stats",
+ "//src/core:arena",
+ "//src/core:call_factory",
+ "//src/core:channel_args",
+ "//src/core:channel_fwd",
+ "//src/core:channel_init",
+ "//src/core:channel_stack_type",
+ "//src/core:closure",
+ "//src/core:dual_ref_counted",
+ "//src/core:error",
+ "//src/core:init_internally",
+ "//src/core:iomgr_fwd",
+ "//src/core:metrics",
+ "//src/core:slice",
+ "//src/core:stats_data",
+ "//src/core:time",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_create",
+ srcs = [
+ "//src/core:lib/surface/channel_create.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/surface/channel_create.h",
+ ],
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/status:statusor",
+ "absl/strings",
+ "absl/types:optional",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "channel",
+ "channel_arg_names",
+ "channelz",
+ "gpr",
+ "grpc_base",
+ "grpc_public_hdrs",
+ "legacy_channel",
+ "ref_counted_ptr",
+ "stats",
+ "//src/core:arena",
+ "//src/core:channel_args",
+ "//src/core:channel_stack_type",
+ "//src/core:iomgr_fwd",
+ "//src/core:ref_counted",
+ "//src/core:slice",
+ "//src/core:stats_data",
+ ],
+)
+
+grpc_cc_library(
+ name = "server",
+ srcs = [
+ "//src/core:lib/surface/server.cc",
+ ],
+ hdrs = [
+ "//src/core:lib/surface/server.h",
+ ],
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/cleanup",
+ "absl/container:flat_hash_map",
+ "absl/container:flat_hash_set",
+ "absl/hash",
+ "absl/random",
+ "absl/status",
+ "absl/status:statusor",
+ "absl/strings",
+ "absl/types:optional",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "api_trace",
+ "call_combiner",
+ "call_tracer",
+ "channel",
+ "channel_arg_names",
+ "channelz",
+ "config",
+ "cpp_impl_of",
+ "debug_location",
+ "exec_ctx",
+ "gpr",
+ "grpc_base",
+ "grpc_public_hdrs",
+ "grpc_trace",
+ "iomgr",
+ "legacy_channel",
+ "orphanable",
+ "promise",
+ "ref_counted_ptr",
+ "stats",
+ "//src/core:1999",
+ "//src/core:activity",
+ "//src/core:arena",
+ "//src/core:arena_promise",
+ "//src/core:cancel_callback",
+ "//src/core:channel_args",
+ "//src/core:channel_args_preconditioning",
+ "//src/core:channel_fwd",
+ "//src/core:channel_stack_type",
+ "//src/core:closure",
+ "//src/core:connectivity_state",
+ "//src/core:context",
+ "//src/core:dual_ref_counted",
+ "//src/core:error",
+ "//src/core:error_utils",
+ "//src/core:experiments",
+ "//src/core:iomgr_fwd",
+ "//src/core:map",
+ "//src/core:metadata_batch",
+ "//src/core:pipe",
+ "//src/core:poll",
+ "//src/core:pollset_set",
+ "//src/core:random_early_detection",
+ "//src/core:seq",
+ "//src/core:server_interface",
+ "//src/core:slice",
+ "//src/core:slice_buffer",
+ "//src/core:status_helper",
+ "//src/core:time",
+ "//src/core:try_join",
+ "//src/core:try_seq",
+ "//src/core:useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_base",
+ srcs = [
"//src/core:lib/channel/channel_stack.cc",
"//src/core:lib/channel/channel_stack_builder_impl.cc",
"//src/core:lib/channel/connected_channel.cc",
"//src/core:lib/channel/promise_based_filter.cc",
- "//src/core:lib/channel/server_call_tracer_filter.cc",
"//src/core:lib/channel/status_util.cc",
- "//src/core:lib/compression/compression.cc",
"//src/core:lib/compression/message_compress.cc",
"//src/core:lib/slice/b64.cc",
- "//src/core:lib/surface/api_trace.cc",
- "//src/core:lib/surface/builtins.cc",
"//src/core:lib/surface/call.cc",
"//src/core:lib/surface/call_details.cc",
"//src/core:lib/surface/call_log_batch.cc",
- "//src/core:lib/surface/channel.cc",
- "//src/core:lib/surface/channel_ping.cc",
"//src/core:lib/surface/completion_queue.cc",
"//src/core:lib/surface/completion_queue_factory.cc",
"//src/core:lib/surface/event_string.cc",
"//src/core:lib/surface/lame_client.cc",
"//src/core:lib/surface/metadata_array.cc",
- "//src/core:lib/surface/server.cc",
"//src/core:lib/surface/validate_metadata.cc",
"//src/core:lib/surface/version.cc",
"//src/core:lib/surface/wait_for_cq_end_op.cc",
@@ -1659,8 +1908,6 @@ grpc_cc_library(
"//src/core:lib/transport/transport_op_string.cc",
],
hdrs = [
- "//src/core:lib/channel/call_finalization.h",
- "//src/core:lib/channel/call_tracer.h",
"//src/core:lib/channel/channel_stack.h",
"//src/core:lib/channel/channel_stack_builder_impl.h",
"//src/core:lib/channel/connected_channel.h",
@@ -1668,17 +1915,13 @@ grpc_cc_library(
"//src/core:lib/channel/status_util.h",
"//src/core:lib/compression/message_compress.h",
"//src/core:lib/slice/b64.h",
- "//src/core:lib/surface/api_trace.h",
- "//src/core:lib/surface/builtins.h",
"//src/core:lib/surface/call.h",
"//src/core:lib/surface/call_test_only.h",
- "//src/core:lib/surface/channel.h",
"//src/core:lib/surface/completion_queue.h",
"//src/core:lib/surface/completion_queue_factory.h",
"//src/core:lib/surface/event_string.h",
"//src/core:lib/surface/init.h",
"//src/core:lib/surface/lame_client.h",
- "//src/core:lib/surface/server.h",
"//src/core:lib/surface/validate_metadata.h",
"//src/core:lib/surface/wait_for_cq_end_op.h",
"//src/core:lib/transport/batch_builder.h",
@@ -1716,9 +1959,12 @@ grpc_cc_library(
public_hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS,
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
+ "api_trace",
"byte_buffer",
"call_combiner",
"call_trace",
+ "call_tracer",
+ "channel",
"channel_arg_names",
"channel_stack_builder",
"channelz",
@@ -1755,6 +2001,7 @@ grpc_cc_library(
"//src/core:call_factory",
"//src/core:call_filters",
"//src/core:call_final_info",
+ "//src/core:call_finalization",
"//src/core:call_spine",
"//src/core:cancel_callback",
"//src/core:channel_args",
@@ -1765,7 +2012,7 @@ grpc_cc_library(
"//src/core:channel_stack_trace",
"//src/core:channel_stack_type",
"//src/core:closure",
- "//src/core:compression_internal",
+ "//src/core:compression",
"//src/core:connectivity_state",
"//src/core:construct_destruct",
"//src/core:context",
@@ -1818,6 +2065,7 @@ grpc_cc_library(
"//src/core:resource_quota",
"//src/core:resource_quota_trace",
"//src/core:seq",
+ "//src/core:server_interface",
"//src/core:slice",
"//src/core:slice_buffer",
"//src/core:slice_cast",
@@ -2013,6 +2261,7 @@ grpc_cc_library(
public_hdrs = GRPC_PUBLIC_HDRS,
visibility = ["@grpc:public"],
deps = [
+ "api_trace",
"call_trace",
"channel_arg_names",
"channelz",
@@ -2196,6 +2445,7 @@ grpc_cc_library(
"legacy_context",
"ref_counted_ptr",
"resource_quota_api",
+ "server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_fwd",
@@ -2274,6 +2524,7 @@ grpc_cc_library(
"legacy_context",
"ref_counted_ptr",
"resource_quota_api",
+ "server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_init",
@@ -2539,6 +2790,7 @@ grpc_cc_library(
],
visibility = ["@grpc:grpc++_test"],
deps = [
+ "channel",
"grpc++",
"grpc_base",
],
@@ -2585,6 +2837,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:grpc_opencensus_plugin"],
deps = [
+ "call_tracer",
"config",
"gpr",
"grpc++_base",
@@ -3313,7 +3566,6 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_client_channel",
srcs = [
- "//src/core:client_channel/channel_connectivity.cc",
"//src/core:client_channel/client_channel_factory.cc",
"//src/core:client_channel/client_channel_filter.cc",
"//src/core:client_channel/client_channel_plugin.cc",
@@ -3356,8 +3608,10 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:client_channel"],
deps = [
+ "api_trace",
"backoff",
"call_combiner",
+ "call_tracer",
"channel_arg_names",
"channelz",
"config",
@@ -3670,6 +3924,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
+ "api_trace",
"exec_ctx",
"gpr",
"grpc_base",
@@ -3757,6 +4012,9 @@ grpc_cc_library(
deps = [
"alts_upb",
"alts_util",
+ "channel",
+ "channel_create",
+ "exec_ctx",
"gpr",
"grpc_base",
"grpc_security_base",
@@ -3921,6 +4179,7 @@ grpc_cc_library(
visibility = ["@grpc:http"],
deps = [
"call_trace",
+ "call_tracer",
"channel_arg_names",
"config",
"gpr",
@@ -3935,7 +4194,7 @@ grpc_cc_library(
"//src/core:channel_args",
"//src/core:channel_fwd",
"//src/core:channel_stack_type",
- "//src/core:compression_internal",
+ "//src/core:compression",
"//src/core:context",
"//src/core:experiments",
"//src/core:grpc_message_size_filter",
@@ -4217,6 +4476,7 @@ grpc_cc_library(
"absl/types:variant",
],
deps = [
+ "call_tracer",
"chttp2_legacy_frame",
"gpr",
"gpr_platform",
@@ -4367,6 +4627,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:grpclb"],
deps = [
+ "call_tracer",
"channel_arg_names",
"channelz",
"chttp2_context_list_entry",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31baf6469d0..d37c313418e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1778,7 +1778,6 @@ endif()
add_library(grpc
src/core/client_channel/backup_poller.cc
- src/core/client_channel/channel_connectivity.cc
src/core/client_channel/client_channel_channelz.cc
src/core/client_channel/client_channel_factory.cc
src/core/client_channel/client_channel_filter.cc
@@ -2453,15 +2452,14 @@ add_library(grpc
src/core/lib/slice/slice_refcount.cc
src/core/lib/slice/slice_string_helpers.cc
src/core/lib/surface/api_trace.cc
- src/core/lib/surface/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
src/core/lib/surface/call_details.cc
src/core/lib/surface/call_log_batch.cc
src/core/lib/surface/channel.cc
+ src/core/lib/surface/channel_create.cc
src/core/lib/surface/channel_init.cc
- src/core/lib/surface/channel_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@@ -2469,6 +2467,7 @@ add_library(grpc
src/core/lib/surface/init.cc
src/core/lib/surface/init_internally.cc
src/core/lib/surface/lame_client.cc
+ src/core/lib/surface/legacy_channel.cc
src/core/lib/surface/metadata_array.cc
src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc
@@ -2879,7 +2878,6 @@ endif()
add_library(grpc_unsecure
src/core/client_channel/backup_poller.cc
- src/core/client_channel/channel_connectivity.cc
src/core/client_channel/client_channel_channelz.cc
src/core/client_channel/client_channel_factory.cc
src/core/client_channel/client_channel_filter.cc
@@ -3184,15 +3182,14 @@ add_library(grpc_unsecure
src/core/lib/slice/slice_refcount.cc
src/core/lib/slice/slice_string_helpers.cc
src/core/lib/surface/api_trace.cc
- src/core/lib/surface/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
src/core/lib/surface/call_details.cc
src/core/lib/surface/call_log_batch.cc
src/core/lib/surface/channel.cc
+ src/core/lib/surface/channel_create.cc
src/core/lib/surface/channel_init.cc
- src/core/lib/surface/channel_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@@ -3200,6 +3197,7 @@ add_library(grpc_unsecure
src/core/lib/surface/init.cc
src/core/lib/surface/init_internally.cc
src/core/lib/surface/lame_client.cc
+ src/core/lib/surface/legacy_channel.cc
src/core/lib/surface/metadata_array.cc
src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc
@@ -5111,7 +5109,6 @@ add_library(grpc_authorization_provider
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/metrics.cc
src/core/lib/channel/promise_based_filter.cc
- src/core/lib/channel/server_call_tracer_filter.cc
src/core/lib/channel/status_util.cc
src/core/lib/compression/compression.cc
src/core/lib/compression/compression_internal.cc
@@ -5312,7 +5309,6 @@ add_library(grpc_authorization_provider
src/core/lib/slice/slice_refcount.cc
src/core/lib/slice/slice_string_helpers.cc
src/core/lib/surface/api_trace.cc
- src/core/lib/surface/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
@@ -5320,7 +5316,6 @@ add_library(grpc_authorization_provider
src/core/lib/surface/call_log_batch.cc
src/core/lib/surface/channel.cc
src/core/lib/surface/channel_init.cc
- src/core/lib/surface/channel_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@@ -5328,7 +5323,6 @@ add_library(grpc_authorization_provider
src/core/lib/surface/init_internally.cc
src/core/lib/surface/lame_client.cc
src/core/lib/surface/metadata_array.cc
- src/core/lib/surface/server.cc
src/core/lib/surface/validate_metadata.cc
src/core/lib/surface/version.cc
src/core/lib/surface/wait_for_cq_end_op.cc
@@ -8438,6 +8432,7 @@ add_executable(call_filters_test
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
src/core/lib/channel/channel_args.cc
+ src/core/lib/compression/compression.cc
src/core/lib/compression/compression_internal.cc
src/core/lib/debug/trace.cc
src/core/lib/experiments/config.cc
@@ -8462,6 +8457,7 @@ add_executable(call_filters_test
src/core/lib/slice/slice_buffer.cc
src/core/lib/slice/slice_refcount.cc
src/core/lib/slice/slice_string_helpers.cc
+ src/core/lib/surface/api_trace.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/transport/call_filters.cc
src/core/lib/transport/call_final_info.cc
diff --git a/Makefile b/Makefile
index 80515ec9a8d..77c838096dd 100644
--- a/Makefile
+++ b/Makefile
@@ -959,7 +959,6 @@ endif
# transitive_deps: ['address_sorting', 'gpr', 'grpc_abseil', 'cares', 'z', 're2', 'upb_textformat_lib', 'upb_json_lib', 'utf8_range_lib', 'upb_message_lib', 'upb_mem_lib', 'upb_base_lib', 'libssl']
LIBGRPC_SRC = \
src/core/client_channel/backup_poller.cc \
- src/core/client_channel/channel_connectivity.cc \
src/core/client_channel/client_channel_channelz.cc \
src/core/client_channel/client_channel_factory.cc \
src/core/client_channel/client_channel_filter.cc \
@@ -1634,15 +1633,14 @@ LIBGRPC_SRC = \
src/core/lib/slice/slice_refcount.cc \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/surface/api_trace.cc \
- src/core/lib/surface/builtins.cc \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
src/core/lib/surface/call_details.cc \
src/core/lib/surface/call_log_batch.cc \
src/core/lib/surface/channel.cc \
+ src/core/lib/surface/channel_create.cc \
src/core/lib/surface/channel_init.cc \
- src/core/lib/surface/channel_ping.cc \
src/core/lib/surface/channel_stack_type.cc \
src/core/lib/surface/completion_queue.cc \
src/core/lib/surface/completion_queue_factory.cc \
@@ -1650,6 +1648,7 @@ LIBGRPC_SRC = \
src/core/lib/surface/init.cc \
src/core/lib/surface/init_internally.cc \
src/core/lib/surface/lame_client.cc \
+ src/core/lib/surface/legacy_channel.cc \
src/core/lib/surface/metadata_array.cc \
src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \
@@ -1893,7 +1892,6 @@ endif
# transitive_deps: ['address_sorting', 'gpr', 'grpc_abseil', 'cares', 'z', 'utf8_range_lib', 'upb_message_lib', 'upb_mem_lib', 'upb_base_lib']
LIBGRPC_UNSECURE_SRC = \
src/core/client_channel/backup_poller.cc \
- src/core/client_channel/channel_connectivity.cc \
src/core/client_channel/client_channel_channelz.cc \
src/core/client_channel/client_channel_factory.cc \
src/core/client_channel/client_channel_filter.cc \
@@ -2198,15 +2196,14 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/slice/slice_refcount.cc \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/surface/api_trace.cc \
- src/core/lib/surface/builtins.cc \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
src/core/lib/surface/call_details.cc \
src/core/lib/surface/call_log_batch.cc \
src/core/lib/surface/channel.cc \
+ src/core/lib/surface/channel_create.cc \
src/core/lib/surface/channel_init.cc \
- src/core/lib/surface/channel_ping.cc \
src/core/lib/surface/channel_stack_type.cc \
src/core/lib/surface/completion_queue.cc \
src/core/lib/surface/completion_queue_factory.cc \
@@ -2214,6 +2211,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/surface/init.cc \
src/core/lib/surface/init_internally.cc \
src/core/lib/surface/lame_client.cc \
+ src/core/lib/surface/legacy_channel.cc \
src/core/lib/surface/metadata_array.cc \
src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \
diff --git a/Package.swift b/Package.swift
index 8a78602f6be..6f480c481de 100644
--- a/Package.swift
+++ b/Package.swift
@@ -117,7 +117,6 @@ let package = Package(
"include/grpc/support/workaround_list.h",
"src/core/client_channel/backup_poller.cc",
"src/core/client_channel/backup_poller.h",
- "src/core/client_channel/channel_connectivity.cc",
"src/core/client_channel/client_channel_channelz.cc",
"src/core/client_channel/client_channel_channelz.h",
"src/core/client_channel/client_channel_factory.cc",
@@ -1760,8 +1759,6 @@ let package = Package(
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/surface/api_trace.cc",
"src/core/lib/surface/api_trace.h",
- "src/core/lib/surface/builtins.cc",
- "src/core/lib/surface/builtins.h",
"src/core/lib/surface/byte_buffer.cc",
"src/core/lib/surface/byte_buffer_reader.cc",
"src/core/lib/surface/call.cc",
@@ -1772,9 +1769,10 @@ let package = Package(
"src/core/lib/surface/call_trace.h",
"src/core/lib/surface/channel.cc",
"src/core/lib/surface/channel.h",
+ "src/core/lib/surface/channel_create.cc",
+ "src/core/lib/surface/channel_create.h",
"src/core/lib/surface/channel_init.cc",
"src/core/lib/surface/channel_init.h",
- "src/core/lib/surface/channel_ping.cc",
"src/core/lib/surface/channel_stack_type.cc",
"src/core/lib/surface/channel_stack_type.h",
"src/core/lib/surface/completion_queue.cc",
@@ -1789,9 +1787,12 @@ let package = Package(
"src/core/lib/surface/init_internally.h",
"src/core/lib/surface/lame_client.cc",
"src/core/lib/surface/lame_client.h",
+ "src/core/lib/surface/legacy_channel.cc",
+ "src/core/lib/surface/legacy_channel.h",
"src/core/lib/surface/metadata_array.cc",
"src/core/lib/surface/server.cc",
"src/core/lib/surface/server.h",
+ "src/core/lib/surface/server_interface.h",
"src/core/lib/surface/validate_metadata.cc",
"src/core/lib/surface/validate_metadata.h",
"src/core/lib/surface/version.cc",
diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml
index 2c44a4f10a5..073ea701ec2 100644
--- a/build_autogenerated.yaml
+++ b/build_autogenerated.yaml
@@ -1111,11 +1111,11 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- - src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
- src/core/lib/surface/channel.h
+ - src/core/lib/surface/channel_create.h
- src/core/lib/surface/channel_init.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/surface/completion_queue.h
@@ -1124,7 +1124,9 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
+ - src/core/lib/surface/legacy_channel.h
- src/core/lib/surface/server.h
+ - src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@@ -1236,7 +1238,6 @@ libs:
- third_party/xxhash/xxhash.h
src:
- src/core/client_channel/backup_poller.cc
- - src/core/client_channel/channel_connectivity.cc
- src/core/client_channel/client_channel_channelz.cc
- src/core/client_channel/client_channel_factory.cc
- src/core/client_channel/client_channel_filter.cc
@@ -1911,15 +1912,14 @@ libs:
- src/core/lib/slice/slice_refcount.cc
- src/core/lib/slice/slice_string_helpers.cc
- src/core/lib/surface/api_trace.cc
- - src/core/lib/surface/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
- src/core/lib/surface/call_details.cc
- src/core/lib/surface/call_log_batch.cc
- src/core/lib/surface/channel.cc
+ - src/core/lib/surface/channel_create.cc
- src/core/lib/surface/channel_init.cc
- - src/core/lib/surface/channel_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@@ -1927,6 +1927,7 @@ libs:
- src/core/lib/surface/init.cc
- src/core/lib/surface/init_internally.cc
- src/core/lib/surface/lame_client.cc
+ - src/core/lib/surface/legacy_channel.cc
- src/core/lib/surface/metadata_array.cc
- src/core/lib/surface/server.cc
- src/core/lib/surface/validate_metadata.cc
@@ -2577,11 +2578,11 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- - src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
- src/core/lib/surface/channel.h
+ - src/core/lib/surface/channel_create.h
- src/core/lib/surface/channel_init.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/surface/completion_queue.h
@@ -2590,7 +2591,9 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
+ - src/core/lib/surface/legacy_channel.h
- src/core/lib/surface/server.h
+ - src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@@ -2692,7 +2695,6 @@ libs:
- third_party/upb/upb/wire/types.h
src:
- src/core/client_channel/backup_poller.cc
- - src/core/client_channel/channel_connectivity.cc
- src/core/client_channel/client_channel_channelz.cc
- src/core/client_channel/client_channel_factory.cc
- src/core/client_channel/client_channel_filter.cc
@@ -2997,15 +2999,14 @@ libs:
- src/core/lib/slice/slice_refcount.cc
- src/core/lib/slice/slice_string_helpers.cc
- src/core/lib/surface/api_trace.cc
- - src/core/lib/surface/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
- src/core/lib/surface/call_details.cc
- src/core/lib/surface/call_log_batch.cc
- src/core/lib/surface/channel.cc
+ - src/core/lib/surface/channel_create.cc
- src/core/lib/surface/channel_init.cc
- - src/core/lib/surface/channel_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@@ -3013,6 +3014,7 @@ libs:
- src/core/lib/surface/init.cc
- src/core/lib/surface/init_internally.cc
- src/core/lib/surface/lame_client.cc
+ - src/core/lib/surface/legacy_channel.cc
- src/core/lib/surface/metadata_array.cc
- src/core/lib/surface/server.cc
- src/core/lib/surface/validate_metadata.cc
@@ -4654,7 +4656,6 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- - src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
@@ -4667,7 +4668,7 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
- - src/core/lib/surface/server.h
+ - src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@@ -4756,7 +4757,6 @@ libs:
- src/core/lib/channel/connected_channel.cc
- src/core/lib/channel/metrics.cc
- src/core/lib/channel/promise_based_filter.cc
- - src/core/lib/channel/server_call_tracer_filter.cc
- src/core/lib/channel/status_util.cc
- src/core/lib/compression/compression.cc
- src/core/lib/compression/compression_internal.cc
@@ -4957,7 +4957,6 @@ libs:
- src/core/lib/slice/slice_refcount.cc
- src/core/lib/slice/slice_string_helpers.cc
- src/core/lib/surface/api_trace.cc
- - src/core/lib/surface/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
@@ -4965,7 +4964,6 @@ libs:
- src/core/lib/surface/call_log_batch.cc
- src/core/lib/surface/channel.cc
- src/core/lib/surface/channel_init.cc
- - src/core/lib/surface/channel_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@@ -4973,7 +4971,6 @@ libs:
- src/core/lib/surface/init_internally.cc
- src/core/lib/surface/lame_client.cc
- src/core/lib/surface/metadata_array.cc
- - src/core/lib/surface/server.cc
- src/core/lib/surface/validate_metadata.cc
- src/core/lib/surface/version.cc
- src/core/lib/surface/wait_for_cq_end_op.cc
@@ -6407,6 +6404,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
+ - src/core/lib/surface/api_trace.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/transport/call_filters.h
- src/core/lib/transport/call_final_info.h
@@ -6447,6 +6445,7 @@ targets:
- src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
- src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
- src/core/lib/channel/channel_args.cc
+ - src/core/lib/compression/compression.cc
- src/core/lib/compression/compression_internal.cc
- src/core/lib/debug/trace.cc
- src/core/lib/experiments/config.cc
@@ -6471,6 +6470,7 @@ targets:
- src/core/lib/slice/slice_buffer.cc
- src/core/lib/slice/slice_refcount.cc
- src/core/lib/slice/slice_string_helpers.cc
+ - src/core/lib/surface/api_trace.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/transport/call_filters.cc
- src/core/lib/transport/call_final_info.cc
diff --git a/config.m4 b/config.m4
index a40bebe4b62..950fdbb4632 100644
--- a/config.m4
+++ b/config.m4
@@ -42,7 +42,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_NEW_EXTENSION(grpc,
src/core/client_channel/backup_poller.cc \
- src/core/client_channel/channel_connectivity.cc \
src/core/client_channel/client_channel_channelz.cc \
src/core/client_channel/client_channel_factory.cc \
src/core/client_channel/client_channel_filter.cc \
@@ -762,15 +761,14 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/slice/slice_refcount.cc \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/surface/api_trace.cc \
- src/core/lib/surface/builtins.cc \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
src/core/lib/surface/call_details.cc \
src/core/lib/surface/call_log_batch.cc \
src/core/lib/surface/channel.cc \
+ src/core/lib/surface/channel_create.cc \
src/core/lib/surface/channel_init.cc \
- src/core/lib/surface/channel_ping.cc \
src/core/lib/surface/channel_stack_type.cc \
src/core/lib/surface/completion_queue.cc \
src/core/lib/surface/completion_queue_factory.cc \
@@ -778,6 +776,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/surface/init.cc \
src/core/lib/surface/init_internally.cc \
src/core/lib/surface/lame_client.cc \
+ src/core/lib/surface/legacy_channel.cc \
src/core/lib/surface/metadata_array.cc \
src/core/lib/surface/server.cc \
src/core/lib/surface/validate_metadata.cc \
diff --git a/config.w32 b/config.w32
index bebb0341fa7..59efe403184 100644
--- a/config.w32
+++ b/config.w32
@@ -7,7 +7,6 @@ if (PHP_GRPC != "no") {
EXTENSION("grpc",
"src\\core\\client_channel\\backup_poller.cc " +
- "src\\core\\client_channel\\channel_connectivity.cc " +
"src\\core\\client_channel\\client_channel_channelz.cc " +
"src\\core\\client_channel\\client_channel_factory.cc " +
"src\\core\\client_channel\\client_channel_filter.cc " +
@@ -727,15 +726,14 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\slice\\slice_refcount.cc " +
"src\\core\\lib\\slice\\slice_string_helpers.cc " +
"src\\core\\lib\\surface\\api_trace.cc " +
- "src\\core\\lib\\surface\\builtins.cc " +
"src\\core\\lib\\surface\\byte_buffer.cc " +
"src\\core\\lib\\surface\\byte_buffer_reader.cc " +
"src\\core\\lib\\surface\\call.cc " +
"src\\core\\lib\\surface\\call_details.cc " +
"src\\core\\lib\\surface\\call_log_batch.cc " +
"src\\core\\lib\\surface\\channel.cc " +
+ "src\\core\\lib\\surface\\channel_create.cc " +
"src\\core\\lib\\surface\\channel_init.cc " +
- "src\\core\\lib\\surface\\channel_ping.cc " +
"src\\core\\lib\\surface\\channel_stack_type.cc " +
"src\\core\\lib\\surface\\completion_queue.cc " +
"src\\core\\lib\\surface\\completion_queue_factory.cc " +
@@ -743,6 +741,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\surface\\init.cc " +
"src\\core\\lib\\surface\\init_internally.cc " +
"src\\core\\lib\\surface\\lame_client.cc " +
+ "src\\core\\lib\\surface\\legacy_channel.cc " +
"src\\core\\lib\\surface\\metadata_array.cc " +
"src\\core\\lib\\surface\\server.cc " +
"src\\core\\lib\\surface\\validate_metadata.cc " +
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index 7fd6798f3cf..a03916faa25 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -1217,11 +1217,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
- 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
+ 'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@@ -1230,7 +1230,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
+ 'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
+ 'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
@@ -2476,11 +2478,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
- 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
+ 'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@@ -2489,7 +2491,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
+ 'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
+ 'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 0d0d8298302..d301e36c83b 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -231,7 +231,6 @@ Pod::Spec.new do |s|
ss.source_files = 'src/core/client_channel/backup_poller.cc',
'src/core/client_channel/backup_poller.h',
- 'src/core/client_channel/channel_connectivity.cc',
'src/core/client_channel/client_channel_channelz.cc',
'src/core/client_channel/client_channel_channelz.h',
'src/core/client_channel/client_channel_factory.cc',
@@ -1870,8 +1869,6 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.cc',
'src/core/lib/surface/api_trace.h',
- 'src/core/lib/surface/builtins.cc',
- 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -1882,9 +1879,10 @@ Pod::Spec.new do |s|
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.cc',
'src/core/lib/surface/channel.h',
+ 'src/core/lib/surface/channel_create.cc',
+ 'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.cc',
'src/core/lib/surface/channel_init.h',
- 'src/core/lib/surface/channel_ping.cc',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.cc',
@@ -1899,9 +1897,12 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/lame_client.h',
+ 'src/core/lib/surface/legacy_channel.cc',
+ 'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/metadata_array.cc',
'src/core/lib/surface/server.cc',
'src/core/lib/surface/server.h',
+ 'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/version.cc',
@@ -3257,11 +3258,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
- 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
+ 'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@@ -3270,7 +3271,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
+ 'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
+ 'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index a0ea7c116de..f31e053b11d 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -123,7 +123,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/workaround_list.h )
s.files += %w( src/core/client_channel/backup_poller.cc )
s.files += %w( src/core/client_channel/backup_poller.h )
- s.files += %w( src/core/client_channel/channel_connectivity.cc )
s.files += %w( src/core/client_channel/client_channel_channelz.cc )
s.files += %w( src/core/client_channel/client_channel_channelz.h )
s.files += %w( src/core/client_channel/client_channel_factory.cc )
@@ -1762,8 +1761,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/slice/slice_string_helpers.h )
s.files += %w( src/core/lib/surface/api_trace.cc )
s.files += %w( src/core/lib/surface/api_trace.h )
- s.files += %w( src/core/lib/surface/builtins.cc )
- s.files += %w( src/core/lib/surface/builtins.h )
s.files += %w( src/core/lib/surface/byte_buffer.cc )
s.files += %w( src/core/lib/surface/byte_buffer_reader.cc )
s.files += %w( src/core/lib/surface/call.cc )
@@ -1774,9 +1771,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/call_trace.h )
s.files += %w( src/core/lib/surface/channel.cc )
s.files += %w( src/core/lib/surface/channel.h )
+ s.files += %w( src/core/lib/surface/channel_create.cc )
+ s.files += %w( src/core/lib/surface/channel_create.h )
s.files += %w( src/core/lib/surface/channel_init.cc )
s.files += %w( src/core/lib/surface/channel_init.h )
- s.files += %w( src/core/lib/surface/channel_ping.cc )
s.files += %w( src/core/lib/surface/channel_stack_type.cc )
s.files += %w( src/core/lib/surface/channel_stack_type.h )
s.files += %w( src/core/lib/surface/completion_queue.cc )
@@ -1791,9 +1789,12 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/init_internally.h )
s.files += %w( src/core/lib/surface/lame_client.cc )
s.files += %w( src/core/lib/surface/lame_client.h )
+ s.files += %w( src/core/lib/surface/legacy_channel.cc )
+ s.files += %w( src/core/lib/surface/legacy_channel.h )
s.files += %w( src/core/lib/surface/metadata_array.cc )
s.files += %w( src/core/lib/surface/server.cc )
s.files += %w( src/core/lib/surface/server.h )
+ s.files += %w( src/core/lib/surface/server_interface.h )
s.files += %w( src/core/lib/surface/validate_metadata.cc )
s.files += %w( src/core/lib/surface/validate_metadata.h )
s.files += %w( src/core/lib/surface/version.cc )
diff --git a/grpc.gyp b/grpc.gyp
index ebd5273440f..fcffddc3163 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -274,7 +274,6 @@
],
'sources': [
'src/core/client_channel/backup_poller.cc',
- 'src/core/client_channel/channel_connectivity.cc',
'src/core/client_channel/client_channel_channelz.cc',
'src/core/client_channel/client_channel_factory.cc',
'src/core/client_channel/client_channel_filter.cc',
@@ -949,15 +948,14 @@
'src/core/lib/slice/slice_refcount.cc',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/surface/api_trace.cc',
- 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
'src/core/lib/surface/call_details.cc',
'src/core/lib/surface/call_log_batch.cc',
'src/core/lib/surface/channel.cc',
+ 'src/core/lib/surface/channel_create.cc',
'src/core/lib/surface/channel_init.cc',
- 'src/core/lib/surface/channel_ping.cc',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/completion_queue.cc',
'src/core/lib/surface/completion_queue_factory.cc',
@@ -965,6 +963,7 @@
'src/core/lib/surface/init.cc',
'src/core/lib/surface/init_internally.cc',
'src/core/lib/surface/lame_client.cc',
+ 'src/core/lib/surface/legacy_channel.cc',
'src/core/lib/surface/metadata_array.cc',
'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc',
@@ -1149,7 +1148,6 @@
],
'sources': [
'src/core/client_channel/backup_poller.cc',
- 'src/core/client_channel/channel_connectivity.cc',
'src/core/client_channel/client_channel_channelz.cc',
'src/core/client_channel/client_channel_factory.cc',
'src/core/client_channel/client_channel_filter.cc',
@@ -1454,15 +1452,14 @@
'src/core/lib/slice/slice_refcount.cc',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/surface/api_trace.cc',
- 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
'src/core/lib/surface/call_details.cc',
'src/core/lib/surface/call_log_batch.cc',
'src/core/lib/surface/channel.cc',
+ 'src/core/lib/surface/channel_create.cc',
'src/core/lib/surface/channel_init.cc',
- 'src/core/lib/surface/channel_ping.cc',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/completion_queue.cc',
'src/core/lib/surface/completion_queue_factory.cc',
@@ -1470,6 +1467,7 @@
'src/core/lib/surface/init.cc',
'src/core/lib/surface/init_internally.cc',
'src/core/lib/surface/lame_client.cc',
+ 'src/core/lib/surface/legacy_channel.cc',
'src/core/lib/surface/metadata_array.cc',
'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc',
@@ -2063,7 +2061,6 @@
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/metrics.cc',
'src/core/lib/channel/promise_based_filter.cc',
- 'src/core/lib/channel/server_call_tracer_filter.cc',
'src/core/lib/channel/status_util.cc',
'src/core/lib/compression/compression.cc',
'src/core/lib/compression/compression_internal.cc',
@@ -2264,7 +2261,6 @@
'src/core/lib/slice/slice_refcount.cc',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/surface/api_trace.cc',
- 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -2272,7 +2268,6 @@
'src/core/lib/surface/call_log_batch.cc',
'src/core/lib/surface/channel.cc',
'src/core/lib/surface/channel_init.cc',
- 'src/core/lib/surface/channel_ping.cc',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/completion_queue.cc',
'src/core/lib/surface/completion_queue_factory.cc',
@@ -2280,7 +2275,6 @@
'src/core/lib/surface/init_internally.cc',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/metadata_array.cc',
- 'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc',
'src/core/lib/surface/wait_for_cq_end_op.cc',
diff --git a/package.xml b/package.xml
index caa7395a997..42ca1197a08 100644
--- a/package.xml
+++ b/package.xml
@@ -105,7 +105,6 @@
-
@@ -1744,8 +1743,6 @@
-
-
@@ -1756,9 +1753,10 @@
+
+
-
@@ -1773,9 +1771,12 @@
+
+
+
diff --git a/src/core/BUILD b/src/core/BUILD
index d329d8c287d..185aa98a554 100644
--- a/src/core/BUILD
+++ b/src/core/BUILD
@@ -113,6 +113,35 @@ grpc_cc_library(
language = "c++",
)
+grpc_cc_library(
+ name = "server_call_tracer_filter",
+ srcs = [
+ "lib/channel/server_call_tracer_filter.cc",
+ ],
+ external_deps = [
+ "absl/status",
+ "absl/status:statusor",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "arena_promise",
+ "call_finalization",
+ "cancel_callback",
+ "channel_args",
+ "channel_fwd",
+ "channel_stack_type",
+ "context",
+ "map",
+ "pipe",
+ "//:call_tracer",
+ "//:config",
+ "//:gpr_platform",
+ "//:grpc_base",
+ "//:legacy_context",
+ ],
+)
+
grpc_cc_library(
name = "atomic_utils",
language = "c++",
@@ -137,6 +166,7 @@ grpc_cc_library(
"hpack_constants",
"metadata_batch",
"slice",
+ "//:call_tracer",
"//:gpr_platform",
"//:grpc_base",
],
@@ -2526,10 +2556,10 @@ grpc_cc_library(
grpc_cc_library(
name = "channel_args_endpoint_config",
srcs = [
- "//src/core:lib/event_engine/channel_args_endpoint_config.cc",
+ "lib/event_engine/channel_args_endpoint_config.cc",
],
hdrs = [
- "//src/core:lib/event_engine/channel_args_endpoint_config.h",
+ "lib/event_engine/channel_args_endpoint_config.h",
],
external_deps = [
"absl/strings",
@@ -2889,6 +2919,19 @@ grpc_cc_library(
],
)
+grpc_cc_library(
+ name = "server_interface",
+ hdrs = [
+ "lib/surface/server_interface.h",
+ ],
+ language = "c++",
+ deps = [
+ "channel_args",
+ "//:channelz",
+ "//:gpr_platform",
+ ],
+)
+
grpc_cc_library(
name = "single_set_ptr",
hdrs = [
@@ -3005,6 +3048,7 @@ grpc_cc_library(
"grpc_service_config",
"lb_policy",
"unique_type_name",
+ "//:call_tracer",
"//:gpr_public_hdrs",
"//:grpc_base",
"//:legacy_context",
@@ -3827,6 +3871,7 @@ grpc_cc_library(
"iomgr_fwd",
"unique_type_name",
"useful",
+ "//:api_trace",
"//:channel_arg_names",
"//:debug_location",
"//:exec_ctx",
@@ -3882,6 +3927,7 @@ grpc_cc_library(
"unique_type_name",
"useful",
"//:alts_util",
+ "//:api_trace",
"//:channel_arg_names",
"//:exec_ctx",
"//:gpr",
@@ -3955,6 +4001,7 @@ grpc_cc_library(
"status_helper",
"unique_type_name",
"useful",
+ "//:api_trace",
"//:channel_arg_names",
"//:debug_location",
"//:exec_ctx",
@@ -3995,6 +4042,7 @@ grpc_cc_library(
"slice",
"unique_type_name",
"useful",
+ "//:api_trace",
"//:exec_ctx",
"//:gpr",
"//:grpc_base",
@@ -4042,6 +4090,7 @@ grpc_cc_library(
"time",
"unique_type_name",
"useful",
+ "//:api_trace",
"//:gpr",
"//:grpc_base",
"//:grpc_credentials_util",
@@ -4687,7 +4736,9 @@ grpc_cc_library(
"useful",
"validation_errors",
"//:backoff",
+ "//:channel",
"//:channel_arg_names",
+ "//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@@ -4786,7 +4837,9 @@ grpc_cc_library(
"time",
"validation_errors",
"//:backoff",
+ "//:channel",
"//:channel_arg_names",
+ "//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@@ -5003,7 +5056,9 @@ grpc_cc_library(
"validation_errors",
"xds_type_upb",
"xds_type_upbdefs",
+ "//:channel",
"//:channel_arg_names",
+ "//:channel_create",
"//:config",
"//:debug_location",
"//:endpoint_addresses",
@@ -5084,6 +5139,7 @@ grpc_cc_library(
"resolved_address",
"slice_refcount",
"unique_type_name",
+ "//:api_trace",
"//:config",
"//:debug_location",
"//:exec_ctx",
@@ -5096,6 +5152,7 @@ grpc_cc_library(
"//:iomgr",
"//:parse_address",
"//:ref_counted_ptr",
+ "//:server",
"//:sockaddr_utils",
"//:uri_parser",
"//:xds_client",
@@ -5969,6 +6026,7 @@ grpc_cc_library(
language = "c++",
deps = [
"arena_promise",
+ "call_finalization",
"channel_args",
"channel_fwd",
"channel_stack_type",
@@ -6636,7 +6694,10 @@ grpc_cc_library(
"tcp_connect_handshaker",
"time",
"unique_type_name",
+ "//:api_trace",
+ "//:channel",
"//:channel_arg_names",
+ "//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@@ -6690,6 +6751,7 @@ grpc_cc_library(
"status_helper",
"time",
"unique_type_name",
+ "//:api_trace",
"//:channel_arg_names",
"//:channelz",
"//:chttp2_legacy_frame",
@@ -6705,6 +6767,7 @@ grpc_cc_library(
"//:iomgr",
"//:orphanable",
"//:ref_counted_ptr",
+ "//:server",
"//:sockaddr_utils",
"//:uri_parser",
],
@@ -6744,7 +6807,10 @@ grpc_cc_library(
"status_helper",
"time",
"try_seq",
+ "//:api_trace",
+ "//:channel",
"//:channel_arg_names",
+ "//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@@ -6756,6 +6822,7 @@ grpc_cc_library(
"//:iomgr",
"//:promise",
"//:ref_counted_ptr",
+ "//:server",
],
)
@@ -6916,6 +6983,7 @@ grpc_cc_library(
"slice",
"slice_buffer",
"time",
+ "//:call_tracer",
"//:channel_arg_names",
"//:config",
"//:gpr",
@@ -7112,6 +7180,21 @@ grpc_cc_library(
],
)
+grpc_cc_library(
+ name = "call_finalization",
+ hdrs = [
+ "lib/channel/call_finalization.h",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "arena",
+ "call_final_info",
+ "context",
+ "//:gpr_platform",
+ ],
+)
+
grpc_cc_library(
name = "call_filters",
srcs = [
@@ -7266,7 +7349,7 @@ grpc_cc_library(
deps = [
"arena",
"chunked_vector",
- "compression_internal",
+ "compression",
"experiments",
"if_list",
"metadata_compression_traits",
@@ -7313,8 +7396,9 @@ grpc_cc_library(
)
grpc_cc_library(
- name = "compression_internal",
+ name = "compression",
srcs = [
+ "lib/compression/compression.cc",
"lib/compression/compression_internal.cc",
],
hdrs = [
@@ -7331,6 +7415,8 @@ grpc_cc_library(
"channel_args",
"ref_counted_string",
"slice",
+ "useful",
+ "//:api_trace",
"//:gpr",
"//:grpc_public_hdrs",
"//:grpc_trace",
@@ -7397,6 +7483,7 @@ grpc_cc_library(
"//:iomgr",
"//:orphanable",
"//:ref_counted_ptr",
+ "//:server",
],
)
@@ -7446,6 +7533,9 @@ grpc_cc_library(
"time",
"try_seq",
"wait_for_callback",
+ "//:api_trace",
+ "//:channel",
+ "//:channel_create",
"//:debug_location",
"//:exec_ctx",
"//:gpr",
diff --git a/src/core/client_channel/channel_connectivity.cc b/src/core/client_channel/channel_connectivity.cc
deleted file mode 100644
index 5ae94d612a5..00000000000
--- a/src/core/client_channel/channel_connectivity.cc
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// 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
-
-#include
-
-#include "absl/base/thread_annotations.h"
-#include "absl/status/status.h"
-#include "absl/types/optional.h"
-
-#include
-#include
-#include
-#include
-#include
-
-#include "src/core/client_channel/client_channel_filter.h"
-#include "src/core/lib/channel/channel_fwd.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/crash.h"
-#include "src/core/lib/gprpp/dual_ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/gprpp/time.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/polling_entity.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/lame_client.h"
-
-namespace grpc_core {
-namespace {
-
-bool IsLameChannel(Channel* channel) {
- grpc_channel_element* elem =
- grpc_channel_stack_last_element(channel->channel_stack());
- return elem->filter == &LameClientFilter::kFilter;
-}
-
-} // namespace
-} // namespace grpc_core
-
-grpc_connectivity_state grpc_channel_check_connectivity_state(
- grpc_channel* c_channel, int try_to_connect) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE(
- "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2,
- (c_channel, try_to_connect));
- grpc_core::Channel* channel = grpc_core::Channel::FromC(c_channel);
- // Forward through to the underlying client channel.
- grpc_core::ClientChannelFilter* client_channel =
- grpc_core::ClientChannelFilter::GetFromChannel(channel);
- if (GPR_UNLIKELY(client_channel == nullptr)) {
- if (grpc_core::IsLameChannel(channel)) {
- return GRPC_CHANNEL_TRANSIENT_FAILURE;
- }
- gpr_log(GPR_ERROR,
- "grpc_channel_check_connectivity_state called on something that is "
- "not a client channel");
- return GRPC_CHANNEL_SHUTDOWN;
- }
- return client_channel->CheckConnectivityState(try_to_connect);
-}
-
-int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
- return grpc_core::ClientChannelFilter::GetFromChannel(
- grpc_core::Channel::FromC(channel)) != nullptr;
-}
-
-namespace grpc_core {
-namespace {
-
-class StateWatcher : public DualRefCounted {
- public:
- StateWatcher(grpc_channel* c_channel, grpc_completion_queue* cq, void* tag,
- grpc_connectivity_state last_observed_state,
- gpr_timespec deadline)
- : channel_(Channel::FromC(c_channel)->Ref()),
- cq_(cq),
- tag_(tag),
- state_(last_observed_state) {
- GPR_ASSERT(grpc_cq_begin_op(cq, tag));
- GRPC_CLOSURE_INIT(&on_complete_, WatchComplete, this, nullptr);
- ClientChannelFilter* client_channel =
- ClientChannelFilter::GetFromChannel(channel_.get());
- if (client_channel == nullptr) {
- // If the target URI used to create the channel was invalid, channel
- // stack initialization failed, and that caused us to create a lame
- // channel. In that case, connectivity state will never change (it
- // will always be TRANSIENT_FAILURE), so we don't actually start a
- // watch, but we are hiding that fact from the application.
- if (IsLameChannel(channel_.get())) {
- // A ref is held by the timer callback.
- StartTimer(Timestamp::FromTimespecRoundUp(deadline));
- // Ref from object creation needs to be freed here since lame channel
- // does not have a watcher.
- Unref();
- return;
- }
- Crash(
- "grpc_channel_watch_connectivity_state called on something that is "
- "not a client channel");
- }
- // Ref from object creation is held by the watcher callback.
- auto* watcher_timer_init_state = new WatcherTimerInitState(
- this, Timestamp::FromTimespecRoundUp(deadline));
- client_channel->AddExternalConnectivityWatcher(
- grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &state_,
- &on_complete_, watcher_timer_init_state->closure());
- }
-
- private:
- // A fire-and-forget object used to delay starting the timer until the
- // ClientChannelFilter actually starts the watch.
- class WatcherTimerInitState {
- public:
- WatcherTimerInitState(StateWatcher* state_watcher, Timestamp deadline)
- : state_watcher_(state_watcher), deadline_(deadline) {
- GRPC_CLOSURE_INIT(&closure_, WatcherTimerInit, this, nullptr);
- }
-
- grpc_closure* closure() { return &closure_; }
-
- private:
- static void WatcherTimerInit(void* arg, grpc_error_handle /*error*/) {
- auto* self = static_cast(arg);
- self->state_watcher_->StartTimer(self->deadline_);
- delete self;
- }
-
- StateWatcher* state_watcher_;
- Timestamp deadline_;
- grpc_closure closure_;
- };
-
- void StartTimer(Timestamp deadline) {
- const Duration timeout = deadline - Timestamp::Now();
- MutexLock lock(&mu_);
- timer_handle_ = channel_->channel_stack()->EventEngine()->RunAfter(
- timeout, [self = Ref()]() mutable {
- ApplicationCallbackExecCtx callback_exec_ctx;
- ExecCtx exec_ctx;
- self->TimeoutComplete();
- // StateWatcher deletion might require an active ExecCtx.
- self.reset();
- });
- }
-
- static void WatchComplete(void* arg, grpc_error_handle error) {
- auto* self = static_cast(arg);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
- GRPC_LOG_IF_ERROR("watch_completion_error", error);
- }
- {
- MutexLock lock(&self->mu_);
- if (self->timer_handle_.has_value()) {
- self->channel_->channel_stack()->EventEngine()->Cancel(
- *self->timer_handle_);
- }
- }
- // Watcher fired when either notified or cancelled, either way the state of
- // this watcher has been cleared from the client channel. Thus there is no
- // need to cancel the watch again.
- self->Unref();
- }
-
- void TimeoutComplete() {
- timer_fired_ = true;
- // If this is a client channel (not a lame channel), cancel the watch.
- ClientChannelFilter* client_channel =
- ClientChannelFilter::GetFromChannel(channel_.get());
- if (client_channel != nullptr) {
- client_channel->CancelExternalConnectivityWatcher(&on_complete_);
- }
- }
-
- // Invoked when both strong refs are released.
- void Orphan() override {
- WeakRef().release(); // Take a weak ref until completion is finished.
- grpc_error_handle error =
- timer_fired_
- ? GRPC_ERROR_CREATE("Timed out waiting for connection state change")
- : absl::OkStatus();
- grpc_cq_end_op(cq_, tag_, error, FinishedCompletion, this,
- &completion_storage_);
- }
-
- // Called when the completion is returned to the CQ.
- static void FinishedCompletion(void* arg, grpc_cq_completion* /*ignored*/) {
- auto* self = static_cast(arg);
- self->WeakUnref();
- }
-
- RefCountedPtr channel_;
- grpc_completion_queue* cq_;
- void* tag_;
-
- grpc_connectivity_state state_;
-
- grpc_cq_completion completion_storage_;
-
- grpc_closure on_complete_;
-
- // timer_handle_ might be accessed in parallel from multiple threads, e.g.
- // timer callback fired immediately on an EventEngine thread before
- // RunAfter() returns.
- Mutex mu_;
- absl::optional
- timer_handle_ ABSL_GUARDED_BY(mu_);
- bool timer_fired_ = false;
-};
-
-} // namespace
-} // namespace grpc_core
-
-void grpc_channel_watch_connectivity_state(
- grpc_channel* channel, grpc_connectivity_state last_observed_state,
- gpr_timespec deadline, grpc_completion_queue* cq, void* tag) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE(
- "grpc_channel_watch_connectivity_state("
- "channel=%p, last_observed_state=%d, "
- "deadline=gpr_timespec { tv_sec: %" PRId64
- ", tv_nsec: %d, clock_type: %d }, "
- "cq=%p, tag=%p)",
- 7,
- (channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
- (int)deadline.clock_type, cq, tag));
- new grpc_core::StateWatcher(channel, cq, tag, last_observed_state, deadline);
-}
diff --git a/src/core/client_channel/client_channel_filter.cc b/src/core/client_channel/client_channel_filter.cc
index 5068ed57ba1..c3820ed8846 100644
--- a/src/core/client_channel/client_channel_filter.cc
+++ b/src/core/client_channel/client_channel_filter.cc
@@ -94,7 +94,6 @@
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -1197,16 +1196,6 @@ class ClientChannelFilter::ClientChannelControlHelper
// ClientChannelFilter implementation
//
-ClientChannelFilter* ClientChannelFilter::GetFromChannel(Channel* channel) {
- grpc_channel_element* elem =
- grpc_channel_stack_last_element(channel->channel_stack());
- if (elem->filter != &kFilterVtableWithPromises &&
- elem->filter != &kFilterVtableWithoutPromises) {
- return nullptr;
- }
- return static_cast(elem->channel_data);
-}
-
grpc_error_handle ClientChannelFilter::Init(grpc_channel_element* elem,
grpc_channel_element_args* args) {
GPR_ASSERT(args->is_last);
diff --git a/src/core/client_channel/client_channel_filter.h b/src/core/client_channel/client_channel_filter.h
index 693366a5b0a..c9d983c2529 100644
--- a/src/core/client_channel/client_channel_filter.h
+++ b/src/core/client_channel/client_channel_filter.h
@@ -65,7 +65,6 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/service_config/service_config.h"
#include "src/core/lib/slice/slice.h"
-#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
@@ -115,10 +114,6 @@ class ClientChannelFilter {
struct RawPointerChannelArgTag {};
static absl::string_view ChannelArgName() { return GRPC_ARG_CLIENT_CHANNEL; }
- // Returns the ClientChannelFilter object from channel, or null if channel
- // is not a client channel.
- static ClientChannelFilter* GetFromChannel(Channel* channel);
-
static ArenaPromise MakeCallPromise(
grpc_channel_element* elem, CallArgs call_args,
NextPromiseFactory next_promise_factory);
diff --git a/src/core/ext/transport/binder/client/channel_create_impl.cc b/src/core/ext/transport/binder/client/channel_create_impl.cc
index 8a60b56c981..8e86d722f03 100644
--- a/src/core/ext/transport/binder/client/channel_create_impl.cc
+++ b/src/core/ext/transport/binder/client/channel_create_impl.cc
@@ -28,6 +28,7 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_create.h"
namespace {
@@ -56,8 +57,8 @@ grpc_channel* CreateDirectBinderChannelImplForTesting(
.PreconditionChannelArgs(args)
.Set(GRPC_ARG_DEFAULT_AUTHORITY, "binder.authority");
auto channel =
- grpc_core::Channel::Create("binder_target_placeholder", channel_args,
- GRPC_CLIENT_DIRECT_CHANNEL, transport);
+ grpc_core::ChannelCreate("binder_target_placeholder", channel_args,
+ GRPC_CLIENT_DIRECT_CHANNEL, transport);
// TODO(mingcl): Handle error properly
GPR_ASSERT(channel.ok());
grpc_channel_args_destroy(args);
@@ -75,8 +76,8 @@ grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) {
.SetObject(g_factory);
auto channel =
- grpc_core::Channel::Create("binder_channel_target_placeholder",
- channel_args, GRPC_CLIENT_CHANNEL, nullptr);
+ grpc_core::ChannelCreate("binder_channel_target_placeholder",
+ channel_args, GRPC_CLIENT_CHANNEL, nullptr);
if (!channel.ok()) {
return grpc_lame_client_channel_create(
diff --git a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
index d7c438b1311..adc2aad7dd3 100644
--- a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
+++ b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
@@ -58,6 +58,7 @@
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/handshaker.h"
#include "src/core/lib/transport/promise_endpoint.h"
@@ -355,7 +356,7 @@ grpc_channel* grpc_chaotic_good_channel_create(const char* target,
std::string canonical_target = grpc_core::CoreConfiguration::Get()
.resolver_registry()
.AddDefaultPrefixIfNeeded(target);
- auto r = grpc_core::Channel::Create(
+ auto r = grpc_core::ChannelCreate(
target,
grpc_core::CoreConfiguration::Get()
.channel_args_preconditioning()
diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index 1d06bfc4cf1..17edffae52a 100644
--- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc
+++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc
@@ -64,6 +64,7 @@
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/handshaker.h"
@@ -307,7 +308,7 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
}
};
-absl::StatusOr> CreateChannel(const char* target,
+absl::StatusOr> CreateChannel(const char* target,
const ChannelArgs& args) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
@@ -317,9 +318,8 @@ absl::StatusOr> CreateChannel(const char* target,
std::string canonical_target =
CoreConfiguration::Get().resolver_registry().AddDefaultPrefixIfNeeded(
target);
- return Channel::Create(target,
- args.Set(GRPC_ARG_SERVER_URI, canonical_target),
- GRPC_CLIENT_CHANNEL, nullptr);
+ return ChannelCreate(target, args.Set(GRPC_ARG_SERVER_URI, canonical_target),
+ GRPC_CLIENT_CHANNEL, nullptr);
}
} // namespace
@@ -410,7 +410,7 @@ grpc_channel* grpc_channel_create_from_fd(const char* target, int fd,
grpc_core::Transport* transport =
grpc_create_chttp2_transport(final_args, client, true);
GPR_ASSERT(transport);
- auto channel = grpc_core::Channel::Create(
+ auto channel = grpc_core::ChannelCreate(
target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);
if (channel.ok()) {
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
diff --git a/src/core/ext/transport/cronet/BUILD b/src/core/ext/transport/cronet/BUILD
index 7387cda260e..20bbbfc2907 100644
--- a/src/core/ext/transport/cronet/BUILD
+++ b/src/core/ext/transport/cronet/BUILD
@@ -47,6 +47,8 @@ grpc_cc_library(
"client/secure/cronet_channel_create.h",
],
deps = [
+ "//:channel",
+ "//:channel_create",
"//:grpc_base",
"//:grpc_transport_chttp2",
"//src/core:channel_args",
diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
index 996fc0dd42e..5431c576eda 100644
--- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
+++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
@@ -32,6 +32,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/transport.h"
@@ -52,7 +53,7 @@ GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
engine, target, channel_args.ToC().get(), reserved);
grpc_core::ExecCtx exec_ctx;
- auto channel = grpc_core::Channel::Create(target, channel_args,
- GRPC_CLIENT_DIRECT_CHANNEL, ct);
+ auto channel = grpc_core::ChannelCreate(target, channel_args,
+ GRPC_CLIENT_DIRECT_CHANNEL, ct);
return channel.ok() ? channel->release()->c_ptr() : nullptr;
}
diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc
index 936068b0aa3..6a335cb0386 100644
--- a/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
@@ -26,6 +26,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/promise/promise.h"
#include "src/core/lib/promise/try_seq.h"
+#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/transport.h"
@@ -155,7 +156,7 @@ bool UsePromiseBasedTransport() {
return true;
}
-RefCountedPtr MakeLameChannel(absl::string_view why,
+OrphanablePtr MakeLameChannel(absl::string_view why,
absl::Status error) {
gpr_log(GPR_ERROR, "%s: %s", std::string(why).c_str(),
std::string(error.message()).c_str());
@@ -164,11 +165,11 @@ RefCountedPtr MakeLameChannel(absl::string_view why,
if (grpc_error_get_int(error, StatusIntProperty::kRpcStatus, &integer)) {
status = static_cast(integer);
}
- return RefCountedPtr(Channel::FromC(grpc_lame_client_channel_create(
+ return OrphanablePtr(Channel::FromC(grpc_lame_client_channel_create(
nullptr, status, std::string(why).c_str())));
}
-RefCountedPtr MakeInprocChannel(Server* server,
+OrphanablePtr MakeInprocChannel(Server* server,
ChannelArgs client_channel_args) {
auto transports = MakeInProcessTransportPair();
auto client_transport = std::move(transports.first);
@@ -183,7 +184,7 @@ RefCountedPtr MakeInprocChannel(Server* server,
return MakeLameChannel("Failed to create server channel", std::move(error));
}
std::ignore = server_transport.release(); // consumed by SetupTransport
- auto channel = Channel::Create(
+ auto channel = ChannelCreate(
"inproc",
client_channel_args.Set(GRPC_ARG_DEFAULT_AUTHORITY, "inproc.authority"),
GRPC_CLIENT_DIRECT_CHANNEL, client_transport.release());
diff --git a/src/core/ext/transport/inproc/legacy_inproc_transport.cc b/src/core/ext/transport/inproc/legacy_inproc_transport.cc
index 66519608870..b560146daf6 100644
--- a/src/core/ext/transport/inproc/legacy_inproc_transport.cc
+++ b/src/core/ext/transport/inproc/legacy_inproc_transport.cc
@@ -61,6 +61,7 @@
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/connectivity_state.h"
@@ -1264,7 +1265,7 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
server_transport, nullptr, server_args, nullptr);
grpc_channel* channel = nullptr;
if (error.ok()) {
- auto new_channel = grpc_core::Channel::Create(
+ auto new_channel = grpc_core::ChannelCreate(
"inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
if (!new_channel.ok()) {
GPR_ASSERT(!channel);
diff --git a/src/core/ext/xds/xds_transport_grpc.cc b/src/core/ext/xds/xds_transport_grpc.cc
index 136a514e131..c3355c1fe6b 100644
--- a/src/core/ext/xds/xds_transport_grpc.cc
+++ b/src/core/ext/xds/xds_transport_grpc.cc
@@ -69,15 +69,16 @@ namespace grpc_core {
//
GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall::GrpcStreamingCall(
- RefCountedPtr factory, grpc_channel* channel,
+ RefCountedPtr factory, Channel* channel,
const char* method,
std::unique_ptr event_handler)
: factory_(std::move(factory)), event_handler_(std::move(event_handler)) {
// Create call.
- call_ = grpc_channel_create_pollset_set_call(
- channel, nullptr, GRPC_PROPAGATE_DEFAULTS, factory_->interested_parties(),
- StaticSlice::FromStaticString(method).c_slice(), nullptr,
- Timestamp::InfFuture(), nullptr);
+ call_ = channel->CreateCall(
+ /*parent_call=*/nullptr, GRPC_PROPAGATE_DEFAULTS, /*cq=*/nullptr,
+ factory_->interested_parties(), Slice::FromStaticString(method),
+ /*authority=*/absl::nullopt, Timestamp::InfFuture(),
+ /*registered_method=*/true);
GPR_ASSERT(call_ != nullptr);
// Init data associated with the call.
grpc_metadata_array_init(&initial_metadata_recv_);
@@ -252,19 +253,13 @@ class GrpcXdsTransportFactory::GrpcXdsTransport::StateWatcher
namespace {
-grpc_channel* CreateXdsChannel(const ChannelArgs& args,
- const GrpcXdsBootstrap::GrpcXdsServer& server) {
+OrphanablePtr CreateXdsChannel(
+ const ChannelArgs& args, const GrpcXdsBootstrap::GrpcXdsServer& server) {
RefCountedPtr channel_creds =
CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
server.channel_creds_config());
- return grpc_channel_create(server.server_uri().c_str(), channel_creds.get(),
- args.ToC().get());
-}
-
-bool IsLameChannel(grpc_channel* channel) {
- grpc_channel_element* elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
- return elem->filter == &LameClientFilter::kFilter;
+ return OrphanablePtr(Channel::FromC(grpc_channel_create(
+ server.server_uri().c_str(), channel_creds.get(), args.ToC().get())));
}
} // namespace
@@ -278,29 +273,19 @@ GrpcXdsTransportFactory::GrpcXdsTransport::GrpcXdsTransport(
factory->args_,
static_cast(server));
GPR_ASSERT(channel_ != nullptr);
- if (IsLameChannel(channel_)) {
+ if (channel_->IsLame()) {
*status = absl::UnavailableError("xds client has a lame channel");
} else {
- ClientChannelFilter* client_channel =
- ClientChannelFilter::GetFromChannel(Channel::FromC(channel_));
- GPR_ASSERT(client_channel != nullptr);
watcher_ = new StateWatcher(std::move(on_connectivity_failure));
- client_channel->AddConnectivityWatcher(
+ channel_->AddConnectivityWatcher(
GRPC_CHANNEL_IDLE,
OrphanablePtr(watcher_));
}
}
-GrpcXdsTransportFactory::GrpcXdsTransport::~GrpcXdsTransport() {
- grpc_channel_destroy_internal(channel_);
-}
-
void GrpcXdsTransportFactory::GrpcXdsTransport::Orphan() {
- if (!IsLameChannel(channel_)) {
- ClientChannelFilter* client_channel =
- ClientChannelFilter::GetFromChannel(Channel::FromC(channel_));
- GPR_ASSERT(client_channel != nullptr);
- client_channel->RemoveConnectivityWatcher(watcher_);
+ if (!channel_->IsLame()) {
+ channel_->RemoveConnectivityWatcher(watcher_);
}
// Do an async hop before unreffing. This avoids a deadlock upon
// shutdown in the case where the xDS channel is itself an xDS channel
@@ -319,11 +304,11 @@ GrpcXdsTransportFactory::GrpcXdsTransport::CreateStreamingCall(
return MakeOrphanable(
factory_->RefAsSubclass(DEBUG_LOCATION,
"StreamingCall"),
- channel_, method, std::move(event_handler));
+ channel_.get(), method, std::move(event_handler));
}
void GrpcXdsTransportFactory::GrpcXdsTransport::ResetBackoff() {
- grpc_channel_reset_connect_backoff(channel_);
+ channel_->ResetConnectionBackoff();
}
//
diff --git a/src/core/ext/xds/xds_transport_grpc.h b/src/core/ext/xds/xds_transport_grpc.h
index a4d25ff75c9..1e80a996cd8 100644
--- a/src/core/ext/xds/xds_transport_grpc.h
+++ b/src/core/ext/xds/xds_transport_grpc.h
@@ -37,6 +37,7 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
+#include "src/core/lib/surface/channel.h"
namespace grpc_core {
@@ -70,7 +71,6 @@ class GrpcXdsTransportFactory::GrpcXdsTransport
const XdsBootstrap::XdsServer& server,
std::function on_connectivity_failure,
absl::Status* status);
- ~GrpcXdsTransport() override;
void Orphan() override;
@@ -84,7 +84,7 @@ class GrpcXdsTransportFactory::GrpcXdsTransport
class StateWatcher;
GrpcXdsTransportFactory* factory_; // Not owned.
- grpc_channel* channel_;
+ OrphanablePtr channel_;
StateWatcher* watcher_;
};
@@ -92,7 +92,7 @@ class GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall
: public XdsTransportFactory::XdsTransport::StreamingCall {
public:
GrpcStreamingCall(RefCountedPtr factory,
- grpc_channel* channel, const char* method,
+ Channel* channel, const char* method,
std::unique_ptr event_handler);
~GrpcStreamingCall() override;
diff --git a/src/core/lib/channel/call_finalization.h b/src/core/lib/channel/call_finalization.h
index 793586f0e3c..a3076677826 100644
--- a/src/core/lib/channel/call_finalization.h
+++ b/src/core/lib/channel/call_finalization.h
@@ -19,9 +19,9 @@
#include
-#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/promise/context.h"
#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/transport/call_final_info.h"
namespace grpc_core {
diff --git a/src/core/lib/channel/call_tracer.h b/src/core/lib/channel/call_tracer.h
index 67191d1bc8a..f189f311963 100644
--- a/src/core/lib/channel/call_tracer.h
+++ b/src/core/lib/channel/call_tracer.h
@@ -36,8 +36,8 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_buffer.h"
+#include "src/core/lib/transport/call_final_info.h"
#include "src/core/lib/transport/metadata_batch.h"
-#include "src/core/lib/transport/transport.h"
namespace grpc_core {
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
index 1713171dd6b..42eb29ef991 100644
--- a/src/core/lib/channel/channelz.h
+++ b/src/core/lib/channel/channelz.h
@@ -191,6 +191,9 @@ class ChannelNode : public BaseNode {
static absl::string_view ChannelArgName() {
return GRPC_ARG_CHANNELZ_CHANNEL_NODE;
}
+ static int ChannelArgsCompare(const ChannelNode* a, const ChannelNode* b) {
+ return QsortCompare(a, b);
+ }
// Returns the string description of the given connectivity state.
static const char* GetChannelConnectivityStateChangeString(
diff --git a/src/core/lib/compression/compression_internal.cc b/src/core/lib/compression/compression_internal.cc
index 484b101b79e..7afb9ac70bf 100644
--- a/src/core/lib/compression/compression_internal.cc
+++ b/src/core/lib/compression/compression_internal.cc
@@ -29,6 +29,7 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
+#include
#include
#include "src/core/lib/channel/channel_args.h"
@@ -239,4 +240,36 @@ DefaultCompressionAlgorithmFromChannelArgs(const ChannelArgs& args) {
return absl::nullopt;
}
+grpc_compression_options CompressionOptionsFromChannelArgs(
+ const ChannelArgs& args) {
+ // Set compression options.
+ grpc_compression_options compression_options;
+ grpc_compression_options_init(&compression_options);
+ auto default_level = args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL);
+ if (default_level.has_value()) {
+ compression_options.default_level.is_set = true;
+ compression_options.default_level.level = Clamp(
+ static_cast(*default_level),
+ GRPC_COMPRESS_LEVEL_NONE,
+ static_cast(GRPC_COMPRESS_LEVEL_COUNT - 1));
+ }
+ auto default_algorithm =
+ args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM);
+ if (default_algorithm.has_value()) {
+ compression_options.default_algorithm.is_set = true;
+ compression_options.default_algorithm.algorithm =
+ Clamp(static_cast(*default_algorithm),
+ GRPC_COMPRESS_NONE,
+ static_cast(
+ GRPC_COMPRESS_ALGORITHMS_COUNT - 1));
+ }
+ auto enabled_algorithms_bitset =
+ args.GetInt(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET);
+ if (enabled_algorithms_bitset.has_value()) {
+ compression_options.enabled_algorithms_bitset =
+ *enabled_algorithms_bitset | 1 /* always support no compression */;
+ }
+ return compression_options;
+}
+
} // namespace grpc_core
diff --git a/src/core/lib/compression/compression_internal.h b/src/core/lib/compression/compression_internal.h
index 4f92f73ee06..ccbdd4aa9d9 100644
--- a/src/core/lib/compression/compression_internal.h
+++ b/src/core/lib/compression/compression_internal.h
@@ -88,6 +88,9 @@ class CompressionAlgorithmSet {
BitSet set_;
};
+grpc_compression_options CompressionOptionsFromChannelArgs(
+ const ChannelArgs& args);
+
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H
diff --git a/src/core/lib/surface/builtins.h b/src/core/lib/surface/builtins.h
deleted file mode 100644
index f027cc364e9..00000000000
--- a/src/core/lib/surface/builtins.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2021 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.
-
-#ifndef GRPC_SRC_CORE_LIB_SURFACE_BUILTINS_H
-#define GRPC_SRC_CORE_LIB_SURFACE_BUILTINS_H
-
-#include
-
-#include "src/core/lib/config/core_configuration.h"
-
-namespace grpc_core {
-void RegisterBuiltins(CoreConfiguration::Builder* builder);
-} // namespace grpc_core
-
-#endif // GRPC_SRC_CORE_LIB_SURFACE_BUILTINS_H
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index b4e66974aaf..3f97df0f81f 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -98,7 +98,7 @@
#include "src/core/lib/surface/call_test_only.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
+#include "src/core/lib/surface/server_interface.h"
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/surface/wait_for_cq_end_op.h"
#include "src/core/lib/transport/batch_builder.h"
@@ -757,7 +757,7 @@ class FilterStackCall final : public Call {
struct {
int* cancelled;
// backpointer to owning server if this is a server side call.
- Server* core_server;
+ ServerInterface* core_server;
} server;
} final_op_;
AtomicError status_error_;
@@ -3368,7 +3368,7 @@ class ServerPromiseBasedCall final : public PromiseBasedCall,
const Completion& completion);
void Finish(ServerMetadataHandle result);
- Server* const server_;
+ ServerInterface* const server_;
const void* const server_transport_data_;
PipeSender* server_initial_metadata_ = nullptr;
PipeSender* server_to_client_messages_ = nullptr;
@@ -3684,7 +3684,7 @@ class ServerCallSpine final : public CallSpineInterface,
public ServerCallContext,
public BasicPromiseBasedCall {
public:
- ServerCallSpine(Server* server, Channel* channel, Arena* arena);
+ ServerCallSpine(ServerInterface* server, Channel* channel, Arena* arena);
// CallSpineInterface
Pipe& client_initial_metadata() override {
@@ -3771,7 +3771,8 @@ class ServerCallSpine final : public CallSpineInterface,
ClientMetadataHandle client_initial_metadata_stored_;
};
-ServerCallSpine::ServerCallSpine(Server* server, Channel* channel, Arena* arena)
+ServerCallSpine::ServerCallSpine(ServerInterface* server, Channel* channel,
+ Arena* arena)
: BasicPromiseBasedCall(arena, 0, 1,
[channel, server]() -> grpc_call_create_args {
grpc_call_create_args args;
@@ -4119,14 +4120,15 @@ void ServerCallSpine::CommitBatch(const grpc_op* ops, size_t nops,
}
}
-RefCountedPtr MakeServerCall(Server* server,
+RefCountedPtr MakeServerCall(ServerInterface* server,
Channel* channel,
Arena* arena) {
return RefCountedPtr(
arena->New(server, channel, arena));
}
#else
-RefCountedPtr MakeServerCall(Server*, Channel*, Arena*) {
+RefCountedPtr MakeServerCall(ServerInterface*, Channel*,
+ Arena*) {
Crash("not implemented");
}
#endif
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h
index 520cf13505c..1736c83fd92 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -50,7 +50,7 @@
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
+#include "src/core/lib/surface/server_interface.h"
#include "src/core/lib/transport/transport.h"
typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
@@ -58,7 +58,7 @@ typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
typedef struct grpc_call_create_args {
grpc_core::RefCountedPtr channel;
- grpc_core::Server* server;
+ grpc_core::ServerInterface* server;
grpc_call* parent;
uint32_t propagation_mask;
@@ -159,7 +159,7 @@ class CallContext {
template <>
struct ContextType {};
-RefCountedPtr MakeServerCall(Server* server,
+RefCountedPtr MakeServerCall(ServerInterface* server,
Channel* channel,
Arena* arena);
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index 0c6f1ef460a..35aa13bd247 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -1,5 +1,4 @@
//
-//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,294 +13,84 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
#include
#include "src/core/lib/surface/channel.h"
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "absl/status/status.h"
-
#include
#include
#include
#include
#include
-#include
#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/channel/metrics.h"
-#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/compression/compression_internal.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/call_factory.h"
-#include "src/core/lib/transport/transport.h"
-
-// IWYU pragma: no_include
namespace grpc_core {
-namespace {
+//
+// Channel::RegisteredCall
+//
-class NotReallyACallFactory final : public CallFactory {
- public:
- using CallFactory::CallFactory;
- CallInitiator CreateCall(ClientMetadataHandle, Arena*) override {
- Crash("NotReallyACallFactory::CreateCall should never be called");
+Channel::RegisteredCall::RegisteredCall(const char* method_arg,
+ const char* host_arg) {
+ path = Slice::FromCopiedString(method_arg);
+ if (host_arg != nullptr && host_arg[0] != 0) {
+ authority = Slice::FromCopiedString(host_arg);
}
-};
-
-} // namespace
-
-Channel::Channel(bool is_client, bool is_promising, std::string target,
- const ChannelArgs& channel_args,
- grpc_compression_options compression_options,
- RefCountedPtr channel_stack)
- : is_client_(is_client),
- is_promising_(is_promising),
- compression_options_(compression_options),
- channelz_node_(channel_args.GetObjectRef()),
- target_(std::move(target)),
- channel_stack_(std::move(channel_stack)),
- call_factory_(MakeRefCounted(channel_args)) {
- // We need to make sure that grpc_shutdown() does not shut things down
- // until after the channel is destroyed. However, the channel may not
- // actually be destroyed by the time grpc_channel_destroy() returns,
- // since there may be other existing refs to the channel. If those
- // refs are held by things that are visible to the wrapped language
- // (such as outstanding calls on the channel), then the wrapped
- // language can be responsible for making sure that grpc_shutdown()
- // does not run until after those refs are released. However, the
- // channel may also have refs to itself held internally for various
- // things that need to be cleaned up at channel destruction (e.g.,
- // LB policies, subchannels, etc), and because these refs are not
- // visible to the wrapped language, it cannot be responsible for
- // deferring grpc_shutdown() until after they are released. To
- // accommodate that, we call grpc_init() here and then call
- // grpc_shutdown() when the channel is actually destroyed, thus
- // ensuring that shutdown is deferred until that point.
- InitInternally();
- auto channelz_node = channelz_node_;
- *channel_stack_->on_destroy = [channelz_node]() {
- if (channelz_node != nullptr) {
- channelz_node->AddTraceEvent(
- channelz::ChannelTrace::Severity::Info,
- grpc_slice_from_static_string("Channel destroyed"));
- }
- ShutdownInternally();
- };
}
-absl::StatusOr> Channel::CreateWithBuilder(
- ChannelStackBuilder* builder) {
- auto channel_args = builder->channel_args();
- if (builder->channel_stack_type() == GRPC_SERVER_CHANNEL) {
- global_stats().IncrementServerChannelsCreated();
- } else {
- global_stats().IncrementClientChannelsCreated();
- }
- absl::StatusOr> r = builder->Build();
- if (!r.ok()) {
- auto status = r.status();
- gpr_log(GPR_ERROR, "channel stack builder failed: %s",
- status.ToString().c_str());
- return status;
- }
-
- grpc_compression_options compression_options;
- grpc_compression_options_init(&compression_options);
- auto default_level =
- channel_args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL);
- if (default_level.has_value()) {
- compression_options.default_level.is_set = true;
- compression_options.default_level.level = Clamp(
- static_cast(*default_level),
- GRPC_COMPRESS_LEVEL_NONE,
- static_cast(GRPC_COMPRESS_LEVEL_COUNT - 1));
- }
- auto default_algorithm =
- channel_args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM);
- if (default_algorithm.has_value()) {
- compression_options.default_algorithm.is_set = true;
- compression_options.default_algorithm.algorithm =
- Clamp(static_cast(*default_algorithm),
- GRPC_COMPRESS_NONE,
- static_cast(
- GRPC_COMPRESS_ALGORITHMS_COUNT - 1));
- }
- auto enabled_algorithms_bitset =
- channel_args.GetInt(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET);
- if (enabled_algorithms_bitset.has_value()) {
- compression_options.enabled_algorithms_bitset =
- *enabled_algorithms_bitset | 1 /* always support no compression */;
+Channel::RegisteredCall::RegisteredCall(const RegisteredCall& other)
+ : path(other.path.Ref()) {
+ if (other.authority.has_value()) {
+ authority = other.authority->Ref();
}
-
- // TODO(roth): Populate authority after merging
- // https://github.com/grpc/grpc/pull/35924.
- StatsPlugin::ChannelScope scope(builder->target(), "");
- *(*r)->stats_plugin_group =
- GlobalStatsPluginRegistry::GetStatsPluginsForChannel(scope);
-
- return RefCountedPtr(new Channel(
- grpc_channel_stack_type_is_client(builder->channel_stack_type()),
- builder->IsPromising(), std::string(builder->target()), channel_args,
- compression_options, std::move(*r)));
}
-namespace {
+Channel::RegisteredCall::~RegisteredCall() {}
-void* channelz_node_copy(void* p) {
- channelz::ChannelNode* node = static_cast(p);
- node->Ref().release();
- return p;
-}
-void channelz_node_destroy(void* p) {
- channelz::ChannelNode* node = static_cast(p);
- node->Unref();
-}
-int channelz_node_cmp(void* p1, void* p2) { return QsortCompare(p1, p2); }
-const grpc_arg_pointer_vtable channelz_node_arg_vtable = {
- channelz_node_copy, channelz_node_destroy, channelz_node_cmp};
-} // namespace
+//
+// Channel
+//
-absl::StatusOr> Channel::Create(
- const char* target, ChannelArgs args,
- grpc_channel_stack_type channel_stack_type, Transport* optional_transport) {
- if (!args.GetString(GRPC_ARG_DEFAULT_AUTHORITY).has_value()) {
- auto ssl_override = args.GetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
- if (ssl_override.has_value()) {
- args = args.Set(GRPC_ARG_DEFAULT_AUTHORITY,
- std::string(ssl_override.value()));
- }
- }
- if (grpc_channel_stack_type_is_client(channel_stack_type)) {
- auto channel_args_mutator =
- grpc_channel_args_get_client_channel_creation_mutator();
- if (channel_args_mutator != nullptr) {
- args = channel_args_mutator(target, args, channel_stack_type);
- }
- }
- // We only need to do this for clients here. For servers, this will be
- // done in src/core/lib/surface/server.cc.
- if (grpc_channel_stack_type_is_client(channel_stack_type)) {
- // Check whether channelz is enabled.
- if (args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
- .value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
- // Get parameters needed to create the channelz node.
- const size_t channel_tracer_max_memory = std::max(
- 0,
- args.GetInt(GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE)
- .value_or(GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT));
- const bool is_internal_channel =
- args.GetBool(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL).value_or(false);
- // Create the channelz node.
- std::string channelz_node_target{target == nullptr ? "unknown" : target};
- RefCountedPtr channelz_node =
- MakeRefCounted(channelz_node_target,
- channel_tracer_max_memory,
- is_internal_channel);
- channelz_node->AddTraceEvent(
- channelz::ChannelTrace::Severity::Info,
- grpc_slice_from_static_string("Channel created"));
- // Add channelz node to channel args.
- // We remove the is_internal_channel arg, since we no longer need it.
- args = args.Remove(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL)
- .Set(GRPC_ARG_CHANNELZ_CHANNEL_NODE,
- ChannelArgs::Pointer(channelz_node.release(),
- &channelz_node_arg_vtable));
- }
- }
- ChannelStackBuilderImpl builder(
- grpc_channel_stack_type_string(channel_stack_type), channel_stack_type,
- args.SetObject(optional_transport));
- builder.SetTarget(target);
- if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
- return nullptr;
+Channel::Channel(std::string target, const ChannelArgs& channel_args)
+ : target_(std::move(target)),
+ channelz_node_(channel_args.GetObjectRef()),
+ compression_options_(CompressionOptionsFromChannelArgs(channel_args)) {}
+
+Channel::RegisteredCall* Channel::RegisterCall(const char* method,
+ const char* host) {
+ MutexLock lock(&mu_);
+ auto key = std::make_pair(std::string(host != nullptr ? host : ""),
+ std::string(method != nullptr ? method : ""));
+ auto rc_posn = registration_table_.find(key);
+ if (rc_posn != registration_table_.end()) {
+ return &rc_posn->second;
}
- return CreateWithBuilder(&builder);
+ auto insertion_result = registration_table_.insert(
+ {std::move(key), RegisteredCall(method, host)});
+ return &insertion_result.first->second;
}
} // namespace grpc_core
-char* grpc_channel_get_target(grpc_channel* channel) {
- GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
- auto target = grpc_core::Channel::FromC(channel)->target();
- char* buffer = static_cast(gpr_zalloc(target.size() + 1));
- memcpy(buffer, target.data(), target.size());
- return buffer;
-}
-
-void grpc_channel_get_info(grpc_channel* channel,
- const grpc_channel_info* channel_info) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- grpc_channel_element* elem = grpc_channel_stack_element(
- grpc_core::Channel::FromC(channel)->channel_stack(), 0);
- elem->filter->get_channel_info(elem, channel_info);
-}
+//
+// C-core API
+//
-void grpc_channel_reset_connect_backoff(grpc_channel* channel) {
+void grpc_channel_destroy(grpc_channel* channel) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE("grpc_channel_reset_connect_backoff(channel=%p)", 1,
- (channel));
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- op->reset_connect_backoff = true;
- grpc_channel_element* elem = grpc_channel_stack_element(
- grpc_core::Channel::FromC(channel)->channel_stack(), 0);
- elem->filter->start_transport_op(elem, op);
-}
-
-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 authority,
- grpc_core::Timestamp deadline, bool registered_method) {
- auto channel = grpc_core::Channel::FromC(c_channel)->Ref();
- GPR_ASSERT(channel->is_client());
- GPR_ASSERT(!(cq != nullptr && pollset_set_alternative != nullptr));
-
- grpc_call_create_args args;
- args.channel = std::move(channel);
- args.server = nullptr;
- args.parent = parent_call;
- args.propagation_mask = propagation_mask;
- args.cq = cq;
- args.pollset_set_alternative = pollset_set_alternative;
- args.server_transport_data = nullptr;
- args.path = std::move(path);
- args.authority = std::move(authority);
- args.send_deadline = deadline;
- args.registered_method = registered_method;
-
- grpc_call* call;
- GRPC_LOG_IF_ERROR("call_create", grpc_call_create(&args, &call));
- return call;
+ GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (channel));
+ grpc_channel_destroy_internal(channel);
}
grpc_call* grpc_channel_create_call(grpc_channel* channel,
@@ -313,52 +102,16 @@ grpc_call* grpc_channel_create_call(grpc_channel* channel,
GPR_ASSERT(!reserved);
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_call* call = grpc_channel_create_call_internal(
- channel, parent_call, propagation_mask, completion_queue, nullptr,
+ return grpc_core::Channel::FromC(channel)->CreateCall(
+ parent_call, propagation_mask, completion_queue, nullptr,
grpc_core::Slice(grpc_core::CSliceRef(method)),
host != nullptr
? absl::optional(grpc_core::CSliceRef(*host))
: absl::nullopt,
grpc_core::Timestamp::FromTimespecRoundUp(deadline),
/*registered_method=*/false);
-
- return call;
-}
-
-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) {
- GPR_ASSERT(!reserved);
- return grpc_channel_create_call_internal(
- channel, parent_call, propagation_mask, nullptr, pollset_set,
- grpc_core::Slice(method),
- host != nullptr
- ? absl::optional(grpc_core::CSliceRef(*host))
- : absl::nullopt,
- deadline, /*registered_method=*/true);
}
-namespace grpc_core {
-
-RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg) {
- path = Slice::FromCopiedString(method_arg);
- if (host_arg != nullptr && host_arg[0] != 0) {
- authority = Slice::FromCopiedString(host_arg);
- }
-}
-
-RegisteredCall::RegisteredCall(const RegisteredCall& other)
- : path(other.path.Ref()) {
- if (other.authority.has_value()) {
- authority = other.authority->Ref();
- }
-}
-
-RegisteredCall::~RegisteredCall() {}
-
-} // namespace grpc_core
-
void* grpc_channel_register_call(grpc_channel* channel, const char* method,
const char* host, void* reserved) {
GRPC_API_TRACE(
@@ -370,29 +123,12 @@ void* grpc_channel_register_call(grpc_channel* channel, const char* method,
return grpc_core::Channel::FromC(channel)->RegisterCall(method, host);
}
-namespace grpc_core {
-
-RegisteredCall* Channel::RegisterCall(const char* method, const char* host) {
- MutexLock lock(®istration_table_.mu);
- auto key = std::make_pair(std::string(host != nullptr ? host : ""),
- std::string(method != nullptr ? method : ""));
- auto rc_posn = registration_table_.map.find(key);
- if (rc_posn != registration_table_.map.end()) {
- return &rc_posn->second;
- }
- auto insertion_result = registration_table_.map.insert(
- {std::move(key), RegisteredCall(method, host)});
- return &insertion_result.first->second;
-}
-
-} // 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) {
- grpc_core::RegisteredCall* rc =
- static_cast(registered_call_handle);
+ auto* rc =
+ static_cast(registered_call_handle);
GRPC_API_TRACE(
"grpc_channel_create_registered_call("
"channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, "
@@ -407,31 +143,77 @@ grpc_call* grpc_channel_create_registered_call(
GPR_ASSERT(!reserved);
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_call* call = grpc_channel_create_call_internal(
- channel, parent_call, propagation_mask, completion_queue, nullptr,
- rc->path.Ref(),
+ return grpc_core::Channel::FromC(channel)->CreateCall(
+ parent_call, propagation_mask, completion_queue, nullptr, rc->path.Ref(),
rc->authority.has_value()
? absl::optional(rc->authority->Ref())
: absl::nullopt,
grpc_core::Timestamp::FromTimespecRoundUp(deadline),
/*registered_method=*/true);
+}
- return call;
+char* grpc_channel_get_target(grpc_channel* channel) {
+ GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
+ auto target = grpc_core::Channel::FromC(channel)->target();
+ char* buffer = static_cast(gpr_zalloc(target.size() + 1));
+ memcpy(buffer, target.data(), target.size());
+ return buffer;
}
-void grpc_channel_destroy_internal(grpc_channel* c_channel) {
- grpc_core::RefCountedPtr channel(
- grpc_core::Channel::FromC(c_channel));
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- grpc_channel_element* elem;
- GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (c_channel));
- op->disconnect_with_error = GRPC_ERROR_CREATE("Channel Destroyed");
- elem = grpc_channel_stack_element(channel->channel_stack(), 0);
- elem->filter->start_transport_op(elem, op);
+void grpc_channel_get_info(grpc_channel* channel,
+ const grpc_channel_info* channel_info) {
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Channel::FromC(channel)->GetInfo(channel_info);
}
-void grpc_channel_destroy(grpc_channel* channel) {
+void grpc_channel_reset_connect_backoff(grpc_channel* channel) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_channel_destroy_internal(channel);
+ GRPC_API_TRACE("grpc_channel_reset_connect_backoff(channel=%p)", 1,
+ (channel));
+ grpc_core::Channel::FromC(channel)->ResetConnectionBackoff();
+}
+
+int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
+ return grpc_core::Channel::FromC(channel)->SupportsConnectivityWatcher();
+}
+
+grpc_connectivity_state grpc_channel_check_connectivity_state(
+ grpc_channel* channel, int try_to_connect) {
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE(
+ "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2,
+ (channel, try_to_connect));
+ return grpc_core::Channel::FromC(channel)->CheckConnectivityState(
+ try_to_connect);
+}
+
+void grpc_channel_watch_connectivity_state(
+ grpc_channel* channel, grpc_connectivity_state last_observed_state,
+ gpr_timespec deadline, grpc_completion_queue* cq, void* tag) {
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE(
+ "grpc_channel_watch_connectivity_state("
+ "channel=%p, last_observed_state=%d, "
+ "deadline=gpr_timespec { tv_sec: %" PRId64
+ ", tv_nsec: %d, clock_type: %d }, "
+ "cq=%p, tag=%p)",
+ 7,
+ (channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
+ (int)deadline.clock_type, cq, tag));
+ return grpc_core::Channel::FromC(channel)->WatchConnectivityState(
+ last_observed_state, grpc_core::Timestamp::FromTimespecRoundUp(deadline),
+ cq, tag);
+}
+
+void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
+ void* tag, void* reserved) {
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE("grpc_channel_ping(channel=%p, cq=%p, tag=%p, reserved=%p)", 4,
+ (channel, cq, tag, reserved));
+ GPR_ASSERT(reserved == nullptr);
+ grpc_core::Channel::FromC(channel)->Ping(cq, tag);
}
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 4796331893e..d41282444a3 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -1,6 +1,5 @@
//
-//
-// Copyright 2015 gRPC authors.
+// Copyright 2024 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,20 +13,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
#ifndef GRPC_SRC_CORE_LIB_SURFACE_CHANNEL_H
#define GRPC_SRC_CORE_LIB_SURFACE_CHANNEL_H
#include
-#include
-#include
-
-#include
#include