aboutsummaryrefslogtreecommitdiff
path: root/src/core/lib/channel/channel_stack.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/channel/channel_stack.cc')
-rw-r--r--src/core/lib/channel/channel_stack.cc37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc
index e4577f073f..528a299632 100644
--- a/src/core/lib/channel/channel_stack.cc
+++ b/src/core/lib/channel/channel_stack.cc
@@ -28,12 +28,21 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_fwd.h"
+#include "src/core/lib/channel/channel_stack_trace.h"
#include "src/core/lib/gpr/alloc.h"
+#include "src/core/lib/surface/channel_init.h"
using grpc_event_engine::experimental::EventEngine;
grpc_core::TraceFlag grpc_trace_channel(false, "channel");
-grpc_core::TraceFlag grpc_trace_channel_stack(false, "channel_stack");
+
+static int register_get_name_fn = []() {
+ grpc_core::NameFromChannelFilter = [](const grpc_channel_filter* filter) {
+ return filter->name;
+ };
+ return 0;
+}();
// Memory layouts.
@@ -312,3 +321,29 @@ grpc_channel_stack::MakeServerCallPromise(grpc_core::CallArgs call_args) {
return ServerNext(grpc_channel_stack_element(this, this->count - 1))(
std::move(call_args));
}
+
+void grpc_channel_stack::InitClientCallSpine(
+ grpc_core::CallSpineInterface* call) {
+ for (size_t i = 0; i < count; i++) {
+ auto* elem = grpc_channel_stack_element(this, i);
+ if (elem->filter->init_call == nullptr) {
+ grpc_core::Crash(
+ absl::StrCat("Filter '", elem->filter->name,
+ "' does not support the call-v3 interface"));
+ }
+ elem->filter->init_call(elem, call);
+ }
+}
+
+void grpc_channel_stack::InitServerCallSpine(
+ grpc_core::CallSpineInterface* call) {
+ for (size_t i = 0; i < count; i++) {
+ auto* elem = grpc_channel_stack_element(this, count - 1 - i);
+ if (elem->filter->init_call == nullptr) {
+ grpc_core::Crash(
+ absl::StrCat("Filter '", elem->filter->name,
+ "' does not support the call-v3 interface"));
+ }
+ elem->filter->init_call(elem, call);
+ }
+}