diff --git a/BUILD b/BUILD
index a3eb58fab04..d92542d4120 100644
--- a/BUILD
+++ b/BUILD
@@ -2769,6 +2769,7 @@ grpc_cc_library(
"//src/core:ext/filters/client_channel/client_channel.h",
"//src/core:ext/filters/client_channel/client_channel_channelz.h",
"//src/core:ext/filters/client_channel/client_channel_factory.h",
+ "//src/core:ext/filters/client_channel/client_channel_internal.h",
"//src/core:ext/filters/client_channel/client_channel_service_config.h",
"//src/core:ext/filters/client_channel/config_selector.h",
"//src/core:ext/filters/client_channel/connector.h",
@@ -2776,7 +2777,6 @@ grpc_cc_library(
"//src/core:ext/filters/client_channel/global_subchannel_pool.h",
"//src/core:ext/filters/client_channel/health/health_check_client.h",
"//src/core:ext/filters/client_channel/http_proxy.h",
- "//src/core:ext/filters/client_channel/lb_call_state_internal.h",
"//src/core:ext/filters/client_channel/lb_policy/child_policy_handler.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h",
diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml
index ead6d3e1f53..8c916906833 100644
--- a/build_autogenerated.yaml
+++ b/build_autogenerated.yaml
@@ -335,6 +335,7 @@ libs:
- src/core/ext/filters/client_channel/client_channel.h
- src/core/ext/filters/client_channel/client_channel_channelz.h
- src/core/ext/filters/client_channel/client_channel_factory.h
+ - src/core/ext/filters/client_channel/client_channel_internal.h
- src/core/ext/filters/client_channel/client_channel_service_config.h
- src/core/ext/filters/client_channel/config_selector.h
- src/core/ext/filters/client_channel/connector.h
@@ -342,7 +343,6 @@ libs:
- src/core/ext/filters/client_channel/global_subchannel_pool.h
- src/core/ext/filters/client_channel/health/health_check_client.h
- src/core/ext/filters/client_channel/http_proxy.h
- - src/core/ext/filters/client_channel/lb_call_state_internal.h
- src/core/ext/filters/client_channel/lb_policy/address_filtering.h
- src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h
- src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
@@ -2005,6 +2005,7 @@ libs:
- src/core/ext/filters/client_channel/client_channel.h
- src/core/ext/filters/client_channel/client_channel_channelz.h
- src/core/ext/filters/client_channel/client_channel_factory.h
+ - src/core/ext/filters/client_channel/client_channel_internal.h
- src/core/ext/filters/client_channel/client_channel_service_config.h
- src/core/ext/filters/client_channel/config_selector.h
- src/core/ext/filters/client_channel/connector.h
@@ -2012,7 +2013,6 @@ libs:
- src/core/ext/filters/client_channel/global_subchannel_pool.h
- src/core/ext/filters/client_channel/health/health_check_client.h
- src/core/ext/filters/client_channel/http_proxy.h
- - src/core/ext/filters/client_channel/lb_call_state_internal.h
- src/core/ext/filters/client_channel/lb_policy/address_filtering.h
- src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h
- src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index a687bdb08f5..300198da9a7 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -248,6 +248,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
+ 'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@@ -255,7 +256,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
- 'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',
@@ -1199,6 +1199,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
+ 'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@@ -1206,7 +1207,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
- 'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 00567f9deda..8f49976734d 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -225,6 +225,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.cc',
'src/core/ext/filters/client_channel/client_channel_factory.h',
+ 'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_plugin.cc',
'src/core/ext/filters/client_channel/client_channel_service_config.cc',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
@@ -239,7 +240,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.cc',
'src/core/ext/filters/client_channel/http_proxy.h',
- 'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.cc',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
@@ -1905,6 +1905,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
'src/core/ext/filters/client_channel/client_channel_factory.h',
+ 'src/core/ext/filters/client_channel/client_channel_internal.h',
'src/core/ext/filters/client_channel/client_channel_service_config.h',
'src/core/ext/filters/client_channel/config_selector.h',
'src/core/ext/filters/client_channel/connector.h',
@@ -1912,7 +1913,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/global_subchannel_pool.h',
'src/core/ext/filters/client_channel/health/health_check_client.h',
'src/core/ext/filters/client_channel/http_proxy.h',
- 'src/core/ext/filters/client_channel/lb_call_state_internal.h',
'src/core/ext/filters/client_channel/lb_policy/address_filtering.h',
'src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h',
'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index 9238063974c..9c82772538d 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -134,6 +134,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/client_channel_channelz.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.h )
+ s.files += %w( src/core/ext/filters/client_channel/client_channel_internal.h )
s.files += %w( src/core/ext/filters/client_channel/client_channel_plugin.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_service_config.cc )
s.files += %w( src/core/ext/filters/client_channel/client_channel_service_config.h )
@@ -148,7 +149,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/health/health_check_client.h )
s.files += %w( src/core/ext/filters/client_channel/http_proxy.cc )
s.files += %w( src/core/ext/filters/client_channel/http_proxy.h )
- s.files += %w( src/core/ext/filters/client_channel/lb_call_state_internal.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/address_filtering.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/address_filtering.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h )
diff --git a/package.xml b/package.xml
index a66d82c92d7..5cba8e170de 100644
--- a/package.xml
+++ b/package.xml
@@ -116,6 +116,7 @@
+
@@ -130,7 +131,6 @@
-
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index bf6e3850b5b..1a42ca33c26 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include "absl/cleanup/cleanup.h"
@@ -48,6 +49,7 @@
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
+#include "src/core/ext/filters/client_channel/client_channel_internal.h"
#include "src/core/ext/filters/client_channel/client_channel_service_config.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/dynamic_filters.h"
@@ -68,6 +70,7 @@
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/handshaker/proxy_mapper_registry.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -2341,6 +2344,25 @@ void ClientChannel::FilterBasedCallData::
error);
}
+//
+// ClientChannel::LoadBalancedCall::LbCallState
+//
+
+class ClientChannel::LoadBalancedCall::LbCallState
+ : public ClientChannelLbCallState {
+ public:
+ explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
+
+ void* Alloc(size_t size) override { return lb_call_->arena()->Alloc(size); }
+
+ // Internal API to allow first-party LB policies to access per-call
+ // attributes set by the ConfigSelector.
+ absl::string_view GetCallAttribute(UniqueTypeName type) override;
+
+ private:
+ LoadBalancedCall* lb_call_;
+};
+
//
// ClientChannel::LoadBalancedCall::Metadata
//
diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h
index 53e836349c3..def4a5cf4d2 100644
--- a/src/core/ext/filters/client_channel/client_channel.h
+++ b/src/core/ext/filters/client_channel/client_channel.h
@@ -25,7 +25,6 @@
#include