Tooling to remove redundant grpc_core:: namespace references (#28030)

* Tooling to remove redundant grpc_core:: namespaces

These references tend to show up in our C++ code after C modules get
converted. Many get caught in review, many get missed.

* use it

* clang-format
pull/27770/head
Craig Tiller 4 years ago committed by GitHub
parent fff84402ac
commit 6af45a35ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/ext/filters/client_channel/client_channel_plugin.cc
  2. 6
      src/core/ext/filters/client_channel/dynamic_filters.cc
  3. 2
      src/core/ext/filters/client_channel/health/health_check_client.h
  4. 14
      src/core/ext/filters/client_channel/http_connect_handshaker.cc
  5. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  6. 3
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
  7. 4
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
  8. 5
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  9. 5
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
  10. 6
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  11. 4
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
  12. 4
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  13. 6
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  14. 7
      src/core/ext/filters/client_channel/resolver_registry.cc
  15. 3
      src/core/ext/filters/client_channel/resolver_registry.h
  16. 8
      src/core/ext/filters/client_channel/subchannel.cc
  17. 2
      src/core/ext/filters/fault_injection/fault_injection_filter.cc
  18. 8
      src/core/ext/filters/http/http_filters_plugin.cc
  19. 2
      src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
  20. 8
      src/core/ext/transport/binder/client/binder_connector.cc
  21. 4
      src/core/ext/transport/binder/client/binder_connector.h
  22. 7
      src/core/ext/transport/binder/server/binder_server.cc
  23. 2
      src/core/ext/transport/chttp2/client/insecure/channel_create.cc
  24. 2
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
  25. 8
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  26. 10
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  27. 5
      src/core/ext/transport/chttp2/transport/context_list.cc
  28. 5
      src/core/ext/transport/chttp2/transport/context_list.h
  29. 4
      src/core/ext/transport/chttp2/transport/flow_control.h
  30. 22
      src/core/ext/transport/chttp2/transport/hpack_encoder.cc
  31. 2
      src/core/ext/transport/chttp2/transport/hpack_encoder.h
  32. 2
      src/core/ext/transport/chttp2/transport/internal.h
  33. 2
      src/core/ext/xds/certificate_provider_store.h
  34. 3
      src/core/ext/xds/xds_certificate_provider.h
  35. 3
      src/core/ext/xds/xds_channel_stack_modifier.cc
  36. 11
      src/core/ext/xds/xds_client.cc
  37. 4
      src/core/lib/backoff/backoff.cc
  38. 12
      src/core/lib/channel/channel_trace.cc
  39. 2
      src/core/lib/channel/channelz.cc
  40. 4
      src/core/lib/debug/trace.h
  41. 14
      src/core/lib/gprpp/global_config_env.cc
  42. 4
      src/core/lib/gprpp/global_config_env.h
  43. 5
      src/core/lib/gprpp/manual_constructor.h
  44. 2
      src/core/lib/gprpp/orphanable.h
  45. 2
      src/core/lib/gprpp/ref_counted.h
  46. 2
      src/core/lib/gprpp/status_helper.h
  47. 2
      src/core/lib/http/httpcli.cc
  48. 18
      src/core/lib/iomgr/buffer_list.cc
  49. 20
      src/core/lib/iomgr/buffer_list.h
  50. 3
      src/core/lib/iomgr/call_combiner.cc
  51. 22
      src/core/lib/iomgr/exec_ctx.h
  52. 25
      src/core/lib/iomgr/executor.cc
  53. 2
      src/core/lib/iomgr/executor.h
  54. 19
      src/core/lib/iomgr/work_serializer.cc
  55. 8
      src/core/lib/iomgr/work_serializer.h
  56. 2
      src/core/lib/json/json_util.cc
  57. 4
      src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
  58. 4
      src/core/lib/security/authorization/grpc_authorization_policy_provider.h
  59. 4
      src/core/lib/security/credentials/google_default/google_default_credentials.cc
  60. 2
      src/core/lib/security/credentials/jwt/jwt_credentials.cc
  61. 20
      src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
  62. 23
      src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
  63. 15
      src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
  64. 6
      src/core/lib/security/security_connector/alts/alts_security_connector.cc
  65. 4
      src/core/lib/security/security_connector/alts/alts_security_connector.h
  66. 4
      src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
  67. 14
      src/core/lib/security/security_connector/insecure/insecure_security_connector.h
  68. 3
      src/core/lib/security/security_connector/load_system_roots_linux.cc
  69. 2
      src/core/lib/security/security_connector/ssl_utils.cc
  70. 2
      src/core/lib/security/security_connector/ssl_utils.h
  71. 4
      src/core/lib/security/transport/security_handshaker.cc
  72. 8
      src/core/lib/slice/slice.cc
  73. 332
      src/core/lib/slice/static_slice.cc
  74. 2
      src/core/lib/surface/builtins.cc
  75. 2
      src/core/lib/surface/channel.h
  76. 2
      src/core/lib/surface/lame_client.cc
  77. 2
      src/core/lib/surface/server.cc
  78. 2
      src/core/lib/transport/bdp_estimator.cc
  79. 8
      src/core/lib/transport/metadata.h
  80. 7
      src/core/lib/transport/metadata_batch.h
  81. 8
      src/core/lib/transport/pid_controller.cc
  82. 588
      src/core/lib/transport/static_metadata.cc
  83. 2
      src/core/tsi/alts/handshaker/alts_handshaker_client.cc
  84. 14
      test/core/channel/channel_trace_test.cc
  85. 38
      test/core/channel/channelz_test.cc
  86. 40
      test/core/client_channel/service_config_test.cc
  87. 38
      test/core/gpr/useful_test.cc
  88. 6
      test/core/gprpp/stat_test.cc
  89. 3
      test/core/promise/promise_factory_test.cc
  90. 2
      test/core/resource_quota/memory_quota_fuzzer.cc
  91. 559
      test/core/security/tls_security_connector_test.cc
  92. 4
      test/core/transport/bdp_estimator_test.cc
  93. 10
      test/core/transport/byte_stream_test.cc
  94. 40
      test/core/transport/chttp2/context_list_test.cc
  95. 12
      test/core/transport/chttp2/hpack_parser_table_test.cc
  96. 6
      test/core/transport/chttp2/hpack_utils_test.cc
  97. 20
      test/core/transport/chttp2/settings_timeout_test.cc
  98. 2
      test/core/util/stack_tracer.cc
  99. 5
      test/core/util/tls_utils.cc
  100. 2
      test/core/util/tls_utils.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -66,8 +66,7 @@ void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) {
GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
[](grpc_channel_stack_builder* builder) { [](grpc_channel_stack_builder* builder) {
return grpc_channel_stack_builder_append_filter( return grpc_channel_stack_builder_append_filter(
builder, &grpc_core::ClientChannel::kFilterVtable, nullptr, builder, &ClientChannel::kFilterVtable, nullptr, nullptr);
nullptr);
}); });
} }

@ -79,7 +79,7 @@ RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref() {
} }
RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref( RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref(
const grpc_core::DebugLocation& location, const char* reason) { const DebugLocation& location, const char* reason) {
IncrementRefCount(location, reason); IncrementRefCount(location, reason);
return RefCountedPtr<DynamicFilters::Call>(this); return RefCountedPtr<DynamicFilters::Call>(this);
} }
@ -112,8 +112,8 @@ void DynamicFilters::Call::IncrementRefCount() {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), ""); GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), "");
} }
void DynamicFilters::Call::IncrementRefCount( void DynamicFilters::Call::IncrementRefCount(const DebugLocation& /*location*/,
const grpc_core::DebugLocation& /*location*/, const char* reason) { const char* reason) {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), reason); GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), reason);
} }

@ -94,7 +94,7 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
grpc_polling_entity pollent_; grpc_polling_entity pollent_;
Arena* arena_; Arena* arena_;
grpc_core::CallCombiner call_combiner_; CallCombiner call_combiner_;
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {}; grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
// The streaming call to the backend. Always non-null. // The streaming call to the backend. Always non-null.

@ -139,11 +139,10 @@ void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error_handle error) {
void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg, void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg,
grpc_error_handle error) { grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg); auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
grpc_core::ExecCtx::Run( ExecCtx::Run(DEBUG_LOCATION,
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&handshaker->request_done_closure_, GRPC_CLOSURE_INIT(&handshaker->request_done_closure_,
&HttpConnectHandshaker::OnWriteDone, handshaker, &HttpConnectHandshaker::OnWriteDone,
grpc_schedule_on_exec_ctx), handshaker, grpc_schedule_on_exec_ctx),
GRPC_ERROR_REF(error)); GRPC_ERROR_REF(error));
} }
@ -174,8 +173,7 @@ void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error_handle error) {
void HttpConnectHandshaker::OnReadDoneScheduler(void* arg, void HttpConnectHandshaker::OnReadDoneScheduler(void* arg,
grpc_error_handle error) { grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg); auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
grpc_core::ExecCtx::Run( ExecCtx::Run(DEBUG_LOCATION,
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&handshaker->response_read_closure_, GRPC_CLOSURE_INIT(&handshaker->response_read_closure_,
&HttpConnectHandshaker::OnReadDone, handshaker, &HttpConnectHandshaker::OnReadDone, handshaker,
grpc_schedule_on_exec_ctx), grpc_schedule_on_exec_ctx),
@ -385,8 +383,8 @@ class HttpConnectHandshakerFactory : public HandshakerFactory {
void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) { void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) {
builder->handshaker_registry()->RegisterHandshakerFactory( builder->handshaker_registry()->RegisterHandshakerFactory(
true /* at_start */, grpc_core::HANDSHAKER_CLIENT, true /* at_start */, HANDSHAKER_CLIENT,
absl::make_unique<grpc_core::HttpConnectHandshakerFactory>()); absl::make_unique<HttpConnectHandshakerFactory>());
} }
} // namespace grpc_core } // namespace grpc_core

@ -1322,8 +1322,7 @@ grpc_channel_args* BuildBalancerChannelArgs(
absl::InlinedVector<grpc_arg, 3> args_to_add = { absl::InlinedVector<grpc_arg, 3> args_to_add = {
// The fake resolver response generator, which we use to inject // The fake resolver response generator, which we use to inject
// address updates into the LB channel. // address updates into the LB channel.
grpc_core::FakeResolverResponseGenerator::MakeChannelArg( FakeResolverResponseGenerator::MakeChannelArg(response_generator),
response_generator),
// A channel arg indicating the target is a grpclb load balancer. // A channel arg indicating the target is a grpclb load balancer.
grpc_channel_arg_integer_create( grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1), const_cast<char*>(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1),

@ -63,8 +63,7 @@ void GrpcLbClientStats::AddCallDropped(const char* token) {
} }
} }
// Not found, so add a new entry. // Not found, so add a new entry.
drop_token_counts_->emplace_back( drop_token_counts_->emplace_back(UniquePtr<char>(gpr_strdup(token)), 1);
grpc_core::UniquePtr<char>(gpr_strdup(token)), 1);
} }
namespace { namespace {

@ -34,10 +34,10 @@ namespace grpc_core {
class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> { class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
public: public:
struct DropTokenCount { struct DropTokenCount {
grpc_core::UniquePtr<char> token; UniquePtr<char> token;
int64_t count; int64_t count;
DropTokenCount(grpc_core::UniquePtr<char> token, int64_t count) DropTokenCount(UniquePtr<char> token, int64_t count)
: token(std::move(token)), count(count) {} : token(std::move(token)), count(count) {}
}; };

@ -747,9 +747,8 @@ class RingHashFactory : public LoadBalancingPolicyFactory {
} // namespace } // namespace
void GrpcLbPolicyRingHashInit() { void GrpcLbPolicyRingHashInit() {
grpc_core::LoadBalancingPolicyRegistry::Builder:: LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
RegisterLoadBalancingPolicyFactory( absl::make_unique<RingHashFactory>());
absl::make_unique<grpc_core::RingHashFactory>());
} }
void GrpcLbPolicyRingHashShutdown() {} void GrpcLbPolicyRingHashShutdown() {}

@ -595,14 +595,13 @@ void XdsClusterResolverLb::UpdateLocked(UpdateArgs args) {
DiscoveryMechanismEntry entry; DiscoveryMechanismEntry entry;
if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism:: if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::EDS) { DiscoveryMechanismType::EDS) {
entry.discovery_mechanism = entry.discovery_mechanism = MakeOrphanable<EdsDiscoveryMechanism>(
grpc_core::MakeOrphanable<EdsDiscoveryMechanism>(
Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"), Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"),
discovery_mechanisms_.size()); discovery_mechanisms_.size());
} else if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism:: } else if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::LOGICAL_DNS) { DiscoveryMechanismType::LOGICAL_DNS) {
entry.discovery_mechanism = entry.discovery_mechanism =
grpc_core::MakeOrphanable<LogicalDNSDiscoveryMechanism>( MakeOrphanable<LogicalDNSDiscoveryMechanism>(
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism"), Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism"),
discovery_mechanisms_.size()); discovery_mechanisms_.size());
} else { } else {

@ -398,10 +398,10 @@ void AresDnsResolver::MaybeStartResolvingLocked() {
const grpc_millis earliest_next_resolution = const grpc_millis earliest_next_resolution =
last_resolution_timestamp_ + min_time_between_resolutions_; last_resolution_timestamp_ + min_time_between_resolutions_;
const grpc_millis ms_until_next_resolution = const grpc_millis ms_until_next_resolution =
earliest_next_resolution - grpc_core::ExecCtx::Get()->Now(); earliest_next_resolution - ExecCtx::Get()->Now();
if (ms_until_next_resolution > 0) { if (ms_until_next_resolution > 0) {
const grpc_millis last_resolution_ago = const grpc_millis last_resolution_ago =
grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_; ExecCtx::Get()->Now() - last_resolution_timestamp_;
GRPC_CARES_TRACE_LOG( GRPC_CARES_TRACE_LOG(
"resolver:%p In cooldown from last resolution (from %" PRId64 "resolver:%p In cooldown from last resolution (from %" PRId64
" ms ago). Will resolve again in %" PRId64 " ms", " ms ago). Will resolve again in %" PRId64 " ms",
@ -434,7 +434,7 @@ void AresDnsResolver::StartResolvingLocked() {
enable_srv_queries_ ? &balancer_addresses_ : nullptr, enable_srv_queries_ ? &balancer_addresses_ : nullptr,
request_service_config_ ? &service_config_json_ : nullptr, request_service_config_ ? &service_config_json_ : nullptr,
query_timeout_ms_, work_serializer_); query_timeout_ms_, work_serializer_);
last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now(); last_resolution_timestamp_ = ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. pending_request_:%p", GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. pending_request_:%p",
this, pending_request_); this, pending_request_);
} }

@ -60,13 +60,13 @@ class GrpcPolledFdFactory {
/* Creates a new wrapped fd for the current platform */ /* Creates a new wrapped fd for the current platform */
virtual GrpcPolledFd* NewGrpcPolledFdLocked( virtual GrpcPolledFd* NewGrpcPolledFdLocked(
ares_socket_t as, grpc_pollset_set* driver_pollset_set, ares_socket_t as, grpc_pollset_set* driver_pollset_set,
std::shared_ptr<grpc_core::WorkSerializer> work_serializer) = 0; std::shared_ptr<WorkSerializer> work_serializer) = 0;
/* Optionally configures the ares channel after creation */ /* Optionally configures the ares channel after creation */
virtual void ConfigureAresChannelLocked(ares_channel channel) = 0; virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
}; };
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory( std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
std::shared_ptr<grpc_core::WorkSerializer> work_serializer); std::shared_ptr<WorkSerializer> work_serializer);
} // namespace grpc_core } // namespace grpc_core

@ -133,12 +133,12 @@ class GrpcPolledFdWindows {
} }
void ScheduleAndNullReadClosure(grpc_error_handle error) { void ScheduleAndNullReadClosure(grpc_error_handle error) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_, error); ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
read_closure_ = nullptr; read_closure_ = nullptr;
} }
void ScheduleAndNullWriteClosure(grpc_error_handle error) { void ScheduleAndNullWriteClosure(grpc_error_handle error) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_, error); ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
write_closure_ = nullptr; write_closure_ = nullptr;
} }

@ -239,10 +239,10 @@ void NativeDnsResolver::MaybeStartResolvingLocked() {
const grpc_millis earliest_next_resolution = const grpc_millis earliest_next_resolution =
last_resolution_timestamp_ + min_time_between_resolutions_; last_resolution_timestamp_ + min_time_between_resolutions_;
const grpc_millis ms_until_next_resolution = const grpc_millis ms_until_next_resolution =
earliest_next_resolution - grpc_core::ExecCtx::Get()->Now(); earliest_next_resolution - ExecCtx::Get()->Now();
if (ms_until_next_resolution > 0) { if (ms_until_next_resolution > 0) {
const grpc_millis last_resolution_ago = const grpc_millis last_resolution_ago =
grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_; ExecCtx::Get()->Now() - last_resolution_timestamp_;
gpr_log(GPR_DEBUG, gpr_log(GPR_DEBUG,
"In cooldown from last resolution (from %" PRId64 "In cooldown from last resolution (from %" PRId64
" ms ago). Will resolve again in %" PRId64 " ms", " ms ago). Will resolve again in %" PRId64 " ms",
@ -277,7 +277,7 @@ void NativeDnsResolver::StartResolvingLocked() {
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_resolve_address(name_to_resolve_.c_str(), kDefaultSecurePort, grpc_resolve_address(name_to_resolve_.c_str(), kDefaultSecurePort,
interested_parties_, &on_resolved_, &addresses_); interested_parties_, &on_resolved_, &addresses_);
last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now(); last_resolution_timestamp_ = ExecCtx::Get()->Now();
} }
// //

@ -104,7 +104,7 @@ class RegistryState {
// hurting performance (which is unlikely, since these allocations // hurting performance (which is unlikely, since these allocations
// only occur at gRPC initialization time). // only occur at gRPC initialization time).
absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_; absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
grpc_core::UniquePtr<char> default_prefix_; UniquePtr<char> default_prefix_;
}; };
static RegistryState* g_state = nullptr; static RegistryState* g_state = nullptr;
@ -181,13 +181,12 @@ std::string ResolverRegistry::GetDefaultAuthority(absl::string_view target) {
return authority; return authority;
} }
grpc_core::UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded( UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(const char* target) {
const char* target) {
GPR_ASSERT(g_state != nullptr); GPR_ASSERT(g_state != nullptr);
URI uri; URI uri;
std::string canonical_target; std::string canonical_target;
g_state->FindResolverFactory(target, &uri, &canonical_target); g_state->FindResolverFactory(target, &uri, &canonical_target);
return grpc_core::UniquePtr<char>(canonical_target.empty() return UniquePtr<char>(canonical_target.empty()
? gpr_strdup(target) ? gpr_strdup(target)
: gpr_strdup(canonical_target.c_str())); : gpr_strdup(canonical_target.c_str()));
} }

@ -76,8 +76,7 @@ class ResolverRegistry {
static std::string GetDefaultAuthority(absl::string_view target); static std::string GetDefaultAuthority(absl::string_view target);
/// Returns \a target with the default prefix prepended, if needed. /// Returns \a target with the default prefix prepended, if needed.
static grpc_core::UniquePtr<char> AddDefaultPrefixIfNeeded( static UniquePtr<char> AddDefaultPrefixIfNeeded(const char* target);
const char* target);
/// Returns the resolver factory for \a scheme. /// Returns the resolver factory for \a scheme.
/// Caller does NOT own the return value. /// Caller does NOT own the return value.

@ -188,8 +188,8 @@ RefCountedPtr<SubchannelCall> SubchannelCall::Ref() {
return RefCountedPtr<SubchannelCall>(this); return RefCountedPtr<SubchannelCall>(this);
} }
RefCountedPtr<SubchannelCall> SubchannelCall::Ref( RefCountedPtr<SubchannelCall> SubchannelCall::Ref(const DebugLocation& location,
const grpc_core::DebugLocation& location, const char* reason) { const char* reason) {
IncrementRefCount(location, reason); IncrementRefCount(location, reason);
return RefCountedPtr<SubchannelCall>(this); return RefCountedPtr<SubchannelCall>(this);
} }
@ -287,8 +287,8 @@ void SubchannelCall::IncrementRefCount() {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), ""); GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), "");
} }
void SubchannelCall::IncrementRefCount( void SubchannelCall::IncrementRefCount(const DebugLocation& /*location*/,
const grpc_core::DebugLocation& /*location*/, const char* reason) { const char* reason) {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason); GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason);
} }

@ -495,7 +495,7 @@ extern const grpc_channel_filter FaultInjectionFilterVtable = {
}; };
void FaultInjectionFilterInit(void) { void FaultInjectionFilterInit(void) {
grpc_core::FaultInjectionServiceConfigParser::Register(); FaultInjectionServiceConfigParser::Register();
} }
void FaultInjectionFilterShutdown(void) {} void FaultInjectionFilterShutdown(void) {}

@ -76,13 +76,11 @@ void RegisterHttpFilters(CoreConfiguration::Builder* builder) {
optional(GRPC_SERVER_CHANNEL, false, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION, optional(GRPC_SERVER_CHANNEL, false, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
&grpc_message_compress_filter); &grpc_message_compress_filter);
optional(GRPC_CLIENT_SUBCHANNEL, true, optional(GRPC_CLIENT_SUBCHANNEL, true,
GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
&grpc_core::MessageDecompressFilter);
optional(GRPC_CLIENT_DIRECT_CHANNEL, true, optional(GRPC_CLIENT_DIRECT_CHANNEL, true,
GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
&grpc_core::MessageDecompressFilter);
optional(GRPC_SERVER_CHANNEL, true, GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, optional(GRPC_SERVER_CHANNEL, true, GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION,
&grpc_core::MessageDecompressFilter); &MessageDecompressFilter);
required(GRPC_CLIENT_SUBCHANNEL, &grpc_http_client_filter); required(GRPC_CLIENT_SUBCHANNEL, &grpc_http_client_filter);
required(GRPC_CLIENT_DIRECT_CHANNEL, &grpc_http_client_filter); required(GRPC_CLIENT_DIRECT_CHANNEL, &grpc_http_client_filter);
required(GRPC_SERVER_CHANNEL, &grpc_http_server_filter); required(GRPC_SERVER_CHANNEL, &grpc_http_server_filter);

@ -84,7 +84,7 @@ class CallData {
void MaybeResumeRecvTrailingMetadataReady(); void MaybeResumeRecvTrailingMetadataReady();
grpc_call_context_element* call_context_; grpc_call_context_element* call_context_;
grpc_core::CallCombiner* call_combiner_; CallCombiner* call_combiner_;
ServiceConfigCallData service_config_call_data_; ServiceConfigCallData service_config_call_data_;
// Overall error for the call // Overall error for the call
grpc_error_handle error_ = GRPC_ERROR_NONE; grpc_error_handle error_ = GRPC_ERROR_NONE;

@ -113,8 +113,7 @@ class BinderConnector : public grpc_core::SubchannelConnector {
namespace grpc_core { namespace grpc_core {
grpc_core::RefCountedPtr<grpc_core::Subchannel> RefCountedPtr<Subchannel> BinderClientChannelFactory::CreateSubchannel(
BinderClientChannelFactory::CreateSubchannel(
const grpc_resolved_address& address, const grpc_channel_args* args) { const grpc_resolved_address& address, const grpc_channel_args* args) {
gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this); gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this);
grpc_arg default_authority_arg = grpc_channel_arg_string_create( grpc_arg default_authority_arg = grpc_channel_arg_string_create(
@ -123,9 +122,8 @@ BinderClientChannelFactory::CreateSubchannel(
grpc_channel_args* new_args = grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &default_authority_arg, 1); grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
grpc_core::RefCountedPtr<grpc_core::Subchannel> s = RefCountedPtr<Subchannel> s =
grpc_core::Subchannel::Create( Subchannel::Create(MakeOrphanable<BinderConnector>(), address, new_args);
grpc_core::MakeOrphanable<BinderConnector>(), address, new_args);
return s; return s;
} }

@ -32,9 +32,9 @@
namespace grpc_core { namespace grpc_core {
class BinderClientChannelFactory : public grpc_core::ClientChannelFactory { class BinderClientChannelFactory : public ClientChannelFactory {
public: public:
grpc_core::RefCountedPtr<grpc_core::Subchannel> CreateSubchannel( RefCountedPtr<Subchannel> CreateSubchannel(
const grpc_resolved_address& address, const grpc_resolved_address& address,
const grpc_channel_args* args) override; const grpc_channel_args* args) override;
}; };

@ -173,7 +173,7 @@ class BinderServerListener : public Server::ListenerInterface {
private: private:
absl::Status OnSetupTransport(transaction_code_t code, absl::Status OnSetupTransport(transaction_code_t code,
grpc_binder::ReadableParcel* parcel, int uid) { grpc_binder::ReadableParcel* parcel, int uid) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
if (grpc_binder::BinderTransportTxCode(code) != if (grpc_binder::BinderTransportTxCode(code) !=
grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT) { grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT) {
return absl::InvalidArgumentError("Not a SETUP_TRANSPORT request"); return absl::InvalidArgumentError("Not a SETUP_TRANSPORT request");
@ -238,10 +238,9 @@ bool AddBinderPort(const std::string& addr, grpc_server* server,
return false; return false;
} }
std::string conn_id = addr.substr(kBinderUriScheme.size()); std::string conn_id = addr.substr(kBinderUriScheme.size());
grpc_core::Server* core_server = server->core_server.get(); Server* core_server = server->core_server.get();
core_server->AddListener( core_server->AddListener(
grpc_core::OrphanablePtr<grpc_core::Server::ListenerInterface>( OrphanablePtr<Server::ListenerInterface>(new BinderServerListener(
new grpc_core::BinderServerListener(
core_server, conn_id, std::move(factory), security_policy))); core_server, conn_id, std::move(factory), security_policy)));
return true; return true;
} }

@ -53,7 +53,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
return nullptr; return nullptr;
} }
// Add channel arg containing the server URI. // Add channel arg containing the server URI.
grpc_core::UniquePtr<char> canonical_target = UniquePtr<char> canonical_target =
ResolverRegistry::AddDefaultPrefixIfNeeded(target); ResolverRegistry::AddDefaultPrefixIfNeeded(target);
grpc_arg arg = grpc_channel_arg_string_create( grpc_arg arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get()); const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());

@ -113,7 +113,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
return nullptr; return nullptr;
} }
// Add channel arg containing the server URI. // Add channel arg containing the server URI.
grpc_core::UniquePtr<char> canonical_target = UniquePtr<char> canonical_target =
ResolverRegistry::AddDefaultPrefixIfNeeded(target); ResolverRegistry::AddDefaultPrefixIfNeeded(target);
grpc_arg arg = grpc_channel_arg_string_create( grpc_arg arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get()); const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());

@ -821,8 +821,8 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
"Invalid address: addr cannot be a nullptr."); "Invalid address: addr cannot be a nullptr.");
} }
if (strncmp(addr, "external:", 9) == 0) { if (strncmp(addr, "external:", 9) == 0) {
return grpc_core::Chttp2ServerListener::CreateWithAcceptor( return Chttp2ServerListener::CreateWithAcceptor(server, addr, args,
server, addr, args, args_modifier); args_modifier);
} }
*port_num = -1; *port_num = -1;
grpc_resolved_addresses* resolved = nullptr; grpc_resolved_addresses* resolved = nullptr;
@ -852,8 +852,8 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
grpc_sockaddr_set_port(&resolved->addrs[i], *port_num); grpc_sockaddr_set_port(&resolved->addrs[i], *port_num);
} }
int port_temp = -1; int port_temp = -1;
error = grpc_core::Chttp2ServerListener::Create( error = Chttp2ServerListener::Create(server, &resolved->addrs[i],
server, &resolved->addrs[i], grpc_channel_args_copy(args), grpc_channel_args_copy(args),
args_modifier, &port_temp); args_modifier, &port_temp);
if (error != GRPC_ERROR_NONE) { if (error != GRPC_ERROR_NONE) {
error_list.push_back(error); error_list.push_back(error);

@ -2991,10 +2991,9 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
grpc_slice_buffer_swap(&s->frame_storage, grpc_slice_buffer_swap(&s->frame_storage,
&s->unprocessed_incoming_frames_buffer); &s->unprocessed_incoming_frames_buffer);
s->unprocessed_incoming_frames_decompressed = false; s->unprocessed_incoming_frames_decompressed = false;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, GRPC_ERROR_NONE);
GRPC_ERROR_NONE);
} else if (s->byte_stream_error != GRPC_ERROR_NONE) { } else if (s->byte_stream_error != GRPC_ERROR_NONE) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
GRPC_ERROR_REF(s->byte_stream_error)); GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) { if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref(); s->data_parser.parsing_frame->Unref();
@ -3004,7 +3003,7 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
if (bs->remaining_bytes_ != 0) { if (bs->remaining_bytes_ != 0) {
s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Truncated message", &s->read_closed_error, 1); "Truncated message", &s->read_closed_error, 1);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
GRPC_ERROR_REF(s->byte_stream_error)); GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) { if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref(); s->data_parser.parsing_frame->Unref();
@ -3093,8 +3092,7 @@ grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) { void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) {
GPR_ASSERT(error != GRPC_ERROR_NONE); GPR_ASSERT(error != GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, GRPC_ERROR_REF(error));
GRPC_ERROR_REF(error));
stream_->on_next = nullptr; stream_->on_next = nullptr;
GRPC_ERROR_UNREF(stream_->byte_stream_error); GRPC_ERROR_UNREF(stream_->byte_stream_error);
stream_->byte_stream_error = GRPC_ERROR_REF(error); stream_->byte_stream_error = GRPC_ERROR_REF(error);

@ -40,8 +40,7 @@ void ContextList::Append(ContextList** head, grpc_chttp2_stream* s) {
*head = elem; *head = elem;
} }
void ContextList::Execute(void* arg, grpc_core::Timestamps* ts, void ContextList::Execute(void* arg, Timestamps* ts, grpc_error_handle error) {
grpc_error_handle error) {
ContextList* head = static_cast<ContextList*>(arg); ContextList* head = static_cast<ContextList*>(arg);
ContextList* to_be_freed; ContextList* to_be_freed;
while (head != nullptr) { while (head != nullptr) {
@ -58,7 +57,7 @@ void ContextList::Execute(void* arg, grpc_core::Timestamps* ts,
} }
void grpc_http2_set_write_timestamps_callback( void grpc_http2_set_write_timestamps_callback(
void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) { void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
write_timestamps_callback_g = fn; write_timestamps_callback_g = fn;
} }

@ -35,8 +35,7 @@ class ContextList {
/* Executes a function \a fn with each context in the list and \a ts. It also /* Executes a function \a fn with each context in the list and \a ts. It also
* frees up the entire list after this operation. It is intended as a callback * frees up the entire list after this operation. It is intended as a callback
* and hence does not take a ref on \a error */ * and hence does not take a ref on \a error */
static void Execute(void* arg, grpc_core::Timestamps* ts, static void Execute(void* arg, Timestamps* ts, grpc_error_handle error);
grpc_error_handle error);
private: private:
void* trace_context_ = nullptr; void* trace_context_ = nullptr;
@ -45,7 +44,7 @@ class ContextList {
}; };
void grpc_http2_set_write_timestamps_callback( void grpc_http2_set_write_timestamps_callback(
void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)); void (*fn)(void*, Timestamps*, grpc_error_handle error));
void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*)); void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*));
} /* namespace grpc_core */ } /* namespace grpc_core */

@ -331,10 +331,10 @@ class TransportFlowControl final : public TransportFlowControlBase {
const bool enable_bdp_probe_; const bool enable_bdp_probe_;
/* bdp estimation */ /* bdp estimation */
grpc_core::BdpEstimator bdp_estimator_; BdpEstimator bdp_estimator_;
/* pid controller */ /* pid controller */
grpc_core::PidController pid_controller_; PidController pid_controller_;
grpc_millis last_pid_update_ = 0; grpc_millis last_pid_update_ = 0;
}; };

@ -420,13 +420,11 @@ void HPackCompressor::Framer::EncodeDynamic(grpc_mdelem elem) {
uint32_t elem_hash = 0; uint32_t elem_hash = 0;
if (elem_interned) { if (elem_interned) {
// Update filter to see if we can perhaps add this elem. // Update filter to see if we can perhaps add this elem.
elem_hash = GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED elem_hash =
? reinterpret_cast<grpc_core::InternedMetadata*>( GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED
GRPC_MDELEM_DATA(elem)) ? reinterpret_cast<InternedMetadata*>(GRPC_MDELEM_DATA(elem))
->hash() ->hash()
: reinterpret_cast<grpc_core::StaticMetadata*>( : reinterpret_cast<StaticMetadata*>(GRPC_MDELEM_DATA(elem))->hash();
GRPC_MDELEM_DATA(elem))
->hash();
bool can_add_to_hashtable = bool can_add_to_hashtable =
compressor_->filter_elems_.AddElement(elem_hash % kNumFilterValues); compressor_->filter_elems_.AddElement(elem_hash % kNumFilterValues);
/* is this elem currently in the decoders table? */ /* is this elem currently in the decoders table? */
@ -443,7 +441,7 @@ void HPackCompressor::Framer::EncodeDynamic(grpc_mdelem elem) {
/* should this elem be in the table? */ /* should this elem be in the table? */
const size_t decoder_space_usage = const size_t decoder_space_usage =
grpc_core::MetadataSizeInHPackTable(elem, use_true_binary_metadata_); MetadataSizeInHPackTable(elem, use_true_binary_metadata_);
const bool decoder_space_available = const bool decoder_space_available =
decoder_space_usage < kMaxDecoderSpaceUsage; decoder_space_usage < kMaxDecoderSpaceUsage;
const bool should_add_elem = const bool should_add_elem =
@ -491,10 +489,9 @@ void HPackCompressor::Framer::Encode(GrpcTimeoutMetadata,
grpc_millis deadline) { grpc_millis deadline) {
char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
grpc_mdelem mdelem; grpc_mdelem mdelem;
grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(), grpc_http2_encode_timeout(deadline - ExecCtx::Get()->Now(), timeout_str);
timeout_str); mdelem = grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TIMEOUT,
mdelem = grpc_mdelem_from_slices( UnmanagedMemorySlice(timeout_str));
GRPC_MDSTR_GRPC_TIMEOUT, grpc_core::UnmanagedMemorySlice(timeout_str));
EncodeDynamic(mdelem); EncodeDynamic(mdelem);
GRPC_MDELEM_UNREF(mdelem); GRPC_MDELEM_UNREF(mdelem);
} }
@ -533,8 +530,7 @@ HPackCompressor::Framer::Framer(const EncodeHeaderOptions& options,
void HPackCompressor::Framer::Encode(grpc_mdelem md) { void HPackCompressor::Framer::Encode(grpc_mdelem md) {
if (GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC) { if (GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC) {
const uintptr_t static_index = const uintptr_t static_index =
reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md)) reinterpret_cast<StaticMetadata*>(GRPC_MDELEM_DATA(md))->StaticIndex();
->StaticIndex();
if (static_index < hpack_constants::kLastStaticEntry) { if (static_index < hpack_constants::kLastStaticEntry) {
EmitIndexed(static_cast<uint32_t>(static_index + 1)); EmitIndexed(static_cast<uint32_t>(static_index + 1));
return; return;

@ -238,7 +238,7 @@ class HPackCompressor {
class KeySliceRef { class KeySliceRef {
public: public:
using Stored = grpc_core::RefCountedPtr<grpc_slice_refcount>; using Stored = RefCountedPtr<grpc_slice_refcount>;
KeySliceRef(grpc_slice_refcount* ref, uint32_t hash) KeySliceRef(grpc_slice_refcount* ref, uint32_t hash)
: ref_(ref), hash_(hash) {} : ref_(ref), hash_(hash) {}

@ -259,7 +259,7 @@ class Chttp2IncomingByteStream : public ByteStream {
grpc_chttp2_transport* transport_; // Immutable. grpc_chttp2_transport* transport_; // Immutable.
grpc_chttp2_stream* stream_; // Immutable. grpc_chttp2_stream* stream_; // Immutable.
grpc_core::RefCount refs_; RefCount refs_;
/* Accessed only by transport thread when stream->pending_byte_stream == false /* Accessed only by transport thread when stream->pending_byte_stream == false
* Accessed only by application thread when stream->pending_byte_stream == * Accessed only by application thread when stream->pending_byte_stream ==

@ -74,7 +74,7 @@ class CertificateProviderStore
store_->ReleaseCertificateProvider(key_, this); store_->ReleaseCertificateProvider(key_, this);
} }
grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor() RefCountedPtr<grpc_tls_certificate_distributor> distributor()
const override { const override {
return certificate_provider_->distributor(); return certificate_provider_->distributor();
} }

@ -34,8 +34,7 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
XdsCertificateProvider(); XdsCertificateProvider();
~XdsCertificateProvider() override; ~XdsCertificateProvider() override;
grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor() RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
const override {
return distributor_; return distributor_;
} }

@ -99,8 +99,7 @@ XdsChannelStackModifier::GetFromChannelArgs(const grpc_channel_args& args) {
void RegisterXdsChannelStackModifier(CoreConfiguration::Builder* builder) { void RegisterXdsChannelStackModifier(CoreConfiguration::Builder* builder) {
builder->channel_init()->RegisterStage( builder->channel_init()->RegisterStage(
GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) { GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) {
grpc_core::RefCountedPtr<XdsChannelStackModifier> RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier =
channel_stack_modifier =
XdsChannelStackModifier::GetFromChannelArgs( XdsChannelStackModifier::GetFromChannelArgs(
*grpc_channel_stack_builder_get_channel_arguments(builder)); *grpc_channel_stack_builder_get_channel_arguments(builder));
if (channel_stack_modifier != nullptr) { if (channel_stack_modifier != nullptr) {

@ -85,7 +85,7 @@ class XdsClient::Notifier {
template <class T> template <class T>
static void ScheduleNotifyWatchersOnErrorInWorkSerializer( static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
XdsClient* xds_client, const T& watchers_list, grpc_error_handle error, XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
const grpc_core::DebugLocation& location) { const DebugLocation& location) {
xds_client->work_serializer_.Schedule( xds_client->work_serializer_.Schedule(
[watchers_list, error]() [watchers_list, error]()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) { ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
@ -103,7 +103,7 @@ class XdsClient::Notifier {
template <class T> template <class T>
static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer( static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
XdsClient* xds_client, const T& watchers_list, XdsClient* xds_client, const T& watchers_list,
const grpc_core::DebugLocation& location) { const DebugLocation& location) {
xds_client->work_serializer_.Schedule( xds_client->work_serializer_.Schedule(
[watchers_list]() [watchers_list]()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) { ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
@ -1490,7 +1490,7 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
xds_client(), grpc_error_std_string(result.parse_error).c_str()); xds_client(), grpc_error_std_string(result.parse_error).c_str());
GRPC_ERROR_UNREF(result.parse_error); GRPC_ERROR_UNREF(result.parse_error);
} else { } else {
grpc_millis update_time = grpc_core::ExecCtx::Get()->Now(); grpc_millis update_time = ExecCtx::Get()->Now();
// Update nonce. // Update nonce.
auto& state = state_map_[result.type_url]; auto& state = state_map_[result.type_url];
state.nonce = std::move(result.nonce); state.nonce = std::move(result.nonce);
@ -2793,7 +2793,7 @@ namespace {
std::string GetBootstrapContents(const char* fallback_config, std::string GetBootstrapContents(const char* fallback_config,
grpc_error_handle* error) { grpc_error_handle* error) {
// First, try GRPC_XDS_BOOTSTRAP env var. // First, try GRPC_XDS_BOOTSTRAP env var.
grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP")); UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
if (path != nullptr) { if (path != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,
@ -2810,8 +2810,7 @@ std::string GetBootstrapContents(const char* fallback_config,
return contents_str; return contents_str;
} }
// Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var. // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
grpc_core::UniquePtr<char> env_config( UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
if (env_config != nullptr) { if (env_config != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,

@ -55,7 +55,7 @@ BackOff::BackOff(const Options& options)
grpc_millis BackOff::NextAttemptTime() { grpc_millis BackOff::NextAttemptTime() {
if (initial_) { if (initial_) {
initial_ = false; initial_ = false;
return current_backoff_ + grpc_core::ExecCtx::Get()->Now(); return current_backoff_ + ExecCtx::Get()->Now();
} }
current_backoff_ = static_cast<grpc_millis>( current_backoff_ = static_cast<grpc_millis>(
std::min(current_backoff_ * options_.multiplier(), std::min(current_backoff_ * options_.multiplier(),
@ -65,7 +65,7 @@ grpc_millis BackOff::NextAttemptTime() {
options_.jitter() * current_backoff_); options_.jitter() * current_backoff_);
const grpc_millis next_timeout = const grpc_millis next_timeout =
static_cast<grpc_millis>(current_backoff_ + jitter); static_cast<grpc_millis>(current_backoff_ + jitter);
return next_timeout + grpc_core::ExecCtx::Get()->Now(); return next_timeout + ExecCtx::Get()->Now();
} }
void BackOff::Reset() { void BackOff::Reset() {

@ -46,8 +46,8 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity) RefCountedPtr<BaseNode> referenced_entity)
: severity_(severity), : severity_(severity),
data_(data), data_(data),
timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), timestamp_(
GPR_CLOCK_REALTIME)), grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)),
next_(nullptr), next_(nullptr),
referenced_entity_(std::move(referenced_entity)), referenced_entity_(std::move(referenced_entity)),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {} memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@ -55,8 +55,8 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data) ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data)
: severity_(severity), : severity_(severity),
data_(data), data_(data),
timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), timestamp_(
GPR_CLOCK_REALTIME)), grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)),
next_(nullptr), next_(nullptr),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {} memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@ -72,8 +72,8 @@ ChannelTrace::ChannelTrace(size_t max_event_memory)
return; // tracing is disabled if max_event_memory_ == 0 return; // tracing is disabled if max_event_memory_ == 0
} }
gpr_mu_init(&tracer_mu_); gpr_mu_init(&tracer_mu_);
time_created_ = grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), time_created_ =
GPR_CLOCK_REALTIME); grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME);
} }
ChannelTrace::~ChannelTrace() { ChannelTrace::~ChannelTrace() {

@ -398,7 +398,7 @@ void SecurityArgDestroy(void* p) {
xds_certificate_provider->Unref(); xds_certificate_provider->Unref();
} }
int SecurityArgCmp(void* p, void* q) { return grpc_core::QsortCompare(p, q); } int SecurityArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kChannelArgVtable = { const grpc_arg_pointer_vtable kChannelArgVtable = {
SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp}; SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp};

@ -56,7 +56,7 @@ class TraceFlagList {
}; };
namespace testing { namespace testing {
void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag); void grpc_tracer_enable_flag(TraceFlag* flag);
} }
class TraceFlag { class TraceFlag {
@ -90,7 +90,7 @@ class TraceFlag {
#endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */ #endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */
private: private:
friend void grpc_core::testing::grpc_tracer_enable_flag(TraceFlag* flag); friend void testing::grpc_tracer_enable_flag(TraceFlag* flag);
friend class TraceFlagList; friend class TraceFlagList;
void set_enabled(bool enabled) { void set_enabled(bool enabled) {

@ -58,8 +58,8 @@ void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func) {
g_global_config_env_error_func = func; g_global_config_env_error_func = func;
} }
grpc_core::UniquePtr<char> GlobalConfigEnv::GetValue() { UniquePtr<char> GlobalConfigEnv::GetValue() {
return grpc_core::UniquePtr<char>(gpr_getenv(GetName())); return UniquePtr<char>(gpr_getenv(GetName()));
} }
void GlobalConfigEnv::SetValue(const char* value) { void GlobalConfigEnv::SetValue(const char* value) {
@ -80,7 +80,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvBool>::value,
"GlobalConfigEnvBool needs to be trivially destructible."); "GlobalConfigEnvBool needs to be trivially destructible.");
bool GlobalConfigEnvBool::Get() { bool GlobalConfigEnvBool::Get() {
grpc_core::UniquePtr<char> str = GetValue(); UniquePtr<char> str = GetValue();
if (str == nullptr) { if (str == nullptr) {
return default_value_; return default_value_;
} }
@ -101,7 +101,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvInt32>::value,
"GlobalConfigEnvInt32 needs to be trivially destructible."); "GlobalConfigEnvInt32 needs to be trivially destructible.");
int32_t GlobalConfigEnvInt32::Get() { int32_t GlobalConfigEnvInt32::Get() {
grpc_core::UniquePtr<char> str = GetValue(); UniquePtr<char> str = GetValue();
if (str == nullptr) { if (str == nullptr) {
return default_value_; return default_value_;
} }
@ -124,10 +124,10 @@ void GlobalConfigEnvInt32::Set(int32_t value) {
static_assert(std::is_trivially_destructible<GlobalConfigEnvString>::value, static_assert(std::is_trivially_destructible<GlobalConfigEnvString>::value,
"GlobalConfigEnvString needs to be trivially destructible."); "GlobalConfigEnvString needs to be trivially destructible.");
grpc_core::UniquePtr<char> GlobalConfigEnvString::Get() { UniquePtr<char> GlobalConfigEnvString::Get() {
grpc_core::UniquePtr<char> str = GetValue(); UniquePtr<char> str = GetValue();
if (str == nullptr) { if (str == nullptr) {
return grpc_core::UniquePtr<char>(gpr_strdup(default_value_)); return UniquePtr<char>(gpr_strdup(default_value_));
} }
return str; return str;
} }

@ -43,7 +43,7 @@ class GlobalConfigEnv {
public: public:
// Returns the value of `name` variable. // Returns the value of `name` variable.
grpc_core::UniquePtr<char> GetValue(); UniquePtr<char> GetValue();
// Sets the value of `name` variable. // Sets the value of `name` variable.
void SetValue(const char* value); void SetValue(const char* value);
@ -87,7 +87,7 @@ class GlobalConfigEnvString : public GlobalConfigEnv {
constexpr GlobalConfigEnvString(char* name, const char* default_value) constexpr GlobalConfigEnvString(char* name, const char* default_value)
: GlobalConfigEnv(name), default_value_(default_value) {} : GlobalConfigEnv(name), default_value_(default_value) {}
grpc_core::UniquePtr<char> Get(); UniquePtr<char> Get();
void Set(const char* value); void Set(const char* value);
private: private:

@ -163,9 +163,8 @@ class PolymorphicManualConstructor {
} }
typename std::aligned_storage< typename std::aligned_storage<
grpc_core::manual_ctor_impl::max_size_of<DerivedTypes...>::value, manual_ctor_impl::max_size_of<DerivedTypes...>::value,
grpc_core::manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type space_;
space_;
}; };
template <typename Type> template <typename Type>

@ -117,7 +117,7 @@ class InternallyRefCounted : public Orphanable {
refs_.Ref(location, reason); refs_.Ref(location, reason);
} }
grpc_core::RefCount refs_; RefCount refs_;
}; };
} // namespace grpc_core } // namespace grpc_core

@ -208,7 +208,7 @@ class PolymorphicRefCount {
}; };
// NonPolymorphicRefCount does not enforce polymorphic destruction of // NonPolymorphicRefCount does not enforce polymorphic destruction of
// RefCounted. Please refer to grpc_core::RefCounted for more details, and // RefCounted. Please refer to RefCounted for more details, and
// when in doubt use PolymorphicRefCount. // when in doubt use PolymorphicRefCount.
class NonPolymorphicRefCount { class NonPolymorphicRefCount {
public: public:

@ -160,7 +160,7 @@ google_rpc_Status* StatusToProto(const absl::Status& status,
/// This is for internal implementation & test only /// This is for internal implementation & test only
absl::Status StatusFromProto(google_rpc_Status* msg) GRPC_MUST_USE_RESULT; absl::Status StatusFromProto(google_rpc_Status* msg) GRPC_MUST_USE_RESULT;
/// The same value of grpc_core::internal::StatusAllocPtr(absl::OkStatus()) /// The same value of internal::StatusAllocPtr(absl::OkStatus())
static constexpr uintptr_t kOkStatusPtr = 0; static constexpr uintptr_t kOkStatusPtr = 0;
/// Returns ptr where the given status is copied into. /// Returns ptr where the given status is copied into.

@ -98,7 +98,7 @@ class InternalRequest {
private: private:
void Finish(grpc_error_handle error) { void Finish(grpc_error_handle error) {
grpc_polling_entity_del_from_pollset_set(pollent_, context_->pollset_set); grpc_polling_entity_del_from_pollset_set(pollent_, context_->pollset_set);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done_, error); ExecCtx::Run(DEBUG_LOCATION, on_done_, error);
delete this; delete this;
} }

@ -40,14 +40,14 @@ void fill_gpr_from_timestamp(gpr_timespec* gts, const struct timespec* ts) {
gts->clock_type = GPR_CLOCK_REALTIME; gts->clock_type = GPR_CLOCK_REALTIME;
} }
void default_timestamps_callback(void* /*arg*/, grpc_core::Timestamps* /*ts*/, void default_timestamps_callback(void* /*arg*/, Timestamps* /*ts*/,
grpc_error_handle /*shudown_err*/) { grpc_error_handle /*shudown_err*/) {
gpr_log(GPR_DEBUG, "Timestamps callback has not been registered"); gpr_log(GPR_DEBUG, "Timestamps callback has not been registered");
} }
/** The saved callback function that will be invoked when we get all the /** The saved callback function that will be invoked when we get all the
* timestamps that we are going to get for a TracedBuffer. */ * timestamps that we are going to get for a TracedBuffer. */
void (*timestamps_callback)(void*, grpc_core::Timestamps*, void (*timestamps_callback)(void*, Timestamps*,
grpc_error_handle shutdown_err) = grpc_error_handle shutdown_err) =
default_timestamps_callback; default_timestamps_callback;
@ -62,11 +62,11 @@ T read_unaligned(const void* ptr) {
/* Extracts opt stats from the tcp_info struct \a info to \a metrics */ /* Extracts opt stats from the tcp_info struct \a info to \a metrics */
void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics, void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
const grpc_core::tcp_info* info) { const tcp_info* info) {
if (info == nullptr) { if (info == nullptr) {
return; return;
} }
if (info->length > offsetof(grpc_core::tcp_info, tcpi_sndbuf_limited)) { if (info->length > offsetof(tcp_info, tcpi_sndbuf_limited)) {
metrics->recurring_retrans.emplace(info->tcpi_retransmits); metrics->recurring_retrans.emplace(info->tcpi_retransmits);
metrics->is_delivery_rate_app_limited.emplace( metrics->is_delivery_rate_app_limited.emplace(
info->tcpi_delivery_rate_app_limited); info->tcpi_delivery_rate_app_limited);
@ -84,7 +84,7 @@ void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
metrics->rwnd_limited_usec.emplace(info->tcpi_rwnd_limited); metrics->rwnd_limited_usec.emplace(info->tcpi_rwnd_limited);
metrics->sndbuf_limited_usec.emplace(info->tcpi_sndbuf_limited); metrics->sndbuf_limited_usec.emplace(info->tcpi_sndbuf_limited);
} }
if (info->length > offsetof(grpc_core::tcp_info, tcpi_dsack_dups)) { if (info->length > offsetof(tcp_info, tcpi_dsack_dups)) {
metrics->data_sent.emplace(info->tcpi_bytes_sent); metrics->data_sent.emplace(info->tcpi_bytes_sent);
metrics->data_retx.emplace(info->tcpi_bytes_retrans); metrics->data_retx.emplace(info->tcpi_bytes_retrans);
metrics->packet_spurious_retx.emplace(info->tcpi_dsack_dups); metrics->packet_spurious_retx.emplace(info->tcpi_dsack_dups);
@ -189,9 +189,9 @@ void extract_opt_stats_from_cmsg(ConnectionMetrics* metrics,
} }
} }
static int get_socket_tcp_info(grpc_core::tcp_info* info, int fd) { static int get_socket_tcp_info(tcp_info* info, int fd) {
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->length = offsetof(grpc_core::tcp_info, length); info->length = offsetof(tcp_info, length);
return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &(info->length)); return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &(info->length));
} }
} /* namespace */ } /* namespace */
@ -286,7 +286,7 @@ void TracedBuffer::Shutdown(TracedBuffer** head, void* remaining,
} }
void grpc_tcp_set_write_timestamps_callback( void grpc_tcp_set_write_timestamps_callback(
void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) { void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
timestamps_callback = fn; timestamps_callback = fn;
} }
} /* namespace grpc_core */ } /* namespace grpc_core */
@ -295,7 +295,7 @@ void grpc_tcp_set_write_timestamps_callback(
namespace grpc_core { namespace grpc_core {
void grpc_tcp_set_write_timestamps_callback( void grpc_tcp_set_write_timestamps_callback(
void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) { void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
// Cast value of fn to void to avoid unused parameter warning. // Cast value of fn to void to avoid unused parameter warning.
// Can't comment out the name because some compilers and formatters don't // Can't comment out the name because some compilers and formatters don't
// like the sequence */* , which would arise from */*fn*/. // like the sequence */* , which would arise from */*fn*/.

@ -96,7 +96,7 @@ struct Timestamps {
uint32_t byte_offset; /* byte offset relative to the start of the RPC */ uint32_t byte_offset; /* byte offset relative to the start of the RPC */
#ifdef GRPC_LINUX_ERRQUEUE #ifdef GRPC_LINUX_ERRQUEUE
grpc_core::tcp_info info; /* tcp_info collected on sendmsg */ tcp_info info; /* tcp_info collected on sendmsg */
#endif /* GRPC_LINUX_ERRQUEUE */ #endif /* GRPC_LINUX_ERRQUEUE */
}; };
@ -105,7 +105,7 @@ struct Timestamps {
* this class would only be used by Linux platforms. For all other platforms, * this class would only be used by Linux platforms. For all other platforms,
* TracedBuffer would be an empty class. * TracedBuffer would be an empty class.
* *
* The timestamps collected are according to grpc_core::Timestamps declared * The timestamps collected are according to Timestamps declared
* above. * above.
* *
* A TracedBuffer list is kept track of using the head element of the list. If * A TracedBuffer list is kept track of using the head element of the list. If
@ -120,33 +120,33 @@ class TracedBuffer {
/** Add a new entry in the TracedBuffer list pointed to by head. Also saves /** Add a new entry in the TracedBuffer list pointed to by head. Also saves
* sendmsg_time with the current timestamp. */ * sendmsg_time with the current timestamp. */
static void AddNewEntry(grpc_core::TracedBuffer** head, uint32_t seq_no, static void AddNewEntry(TracedBuffer** head, uint32_t seq_no, int fd,
int fd, void* arg); void* arg);
/** Processes a received timestamp based on sock_extended_err and /** Processes a received timestamp based on sock_extended_err and
* scm_timestamping structures. It will invoke the timestamps callback if the * scm_timestamping structures. It will invoke the timestamps callback if the
* timestamp type is SCM_TSTAMP_ACK. */ * timestamp type is SCM_TSTAMP_ACK. */
static void ProcessTimestamp(grpc_core::TracedBuffer** head, static void ProcessTimestamp(TracedBuffer** head,
struct sock_extended_err* serr, struct sock_extended_err* serr,
struct cmsghdr* opt_stats, struct cmsghdr* opt_stats,
struct scm_timestamping* tss); struct scm_timestamping* tss);
/** Cleans the list by calling the callback for each traced buffer in the list /** Cleans the list by calling the callback for each traced buffer in the list
* with timestamps that it has. */ * with timestamps that it has. */
static void Shutdown(grpc_core::TracedBuffer** head, void* remaining, static void Shutdown(TracedBuffer** head, void* remaining,
grpc_error_handle shutdown_err); grpc_error_handle shutdown_err);
private: private:
uint32_t seq_no_; /* The sequence number for the last byte in the buffer */ uint32_t seq_no_; /* The sequence number for the last byte in the buffer */
void* arg_; /* The arg to pass to timestamps_callback */ void* arg_; /* The arg to pass to timestamps_callback */
grpc_core::Timestamps ts_; /* The timestamps corresponding to this buffer */ Timestamps ts_; /* The timestamps corresponding to this buffer */
grpc_core::TracedBuffer* next_; /* The next TracedBuffer in the list */ TracedBuffer* next_; /* The next TracedBuffer in the list */
}; };
#else /* GRPC_LINUX_ERRQUEUE */ #else /* GRPC_LINUX_ERRQUEUE */
class TracedBuffer { class TracedBuffer {
public: public:
/* Phony shutdown function */ /* Phony shutdown function */
static void Shutdown(grpc_core::TracedBuffer** /*head*/, void* /*remaining*/, static void Shutdown(TracedBuffer** /*head*/, void* /*remaining*/,
grpc_error_handle shutdown_err) { grpc_error_handle shutdown_err) {
GRPC_ERROR_UNREF(shutdown_err); GRPC_ERROR_UNREF(shutdown_err);
} }
@ -156,7 +156,7 @@ class TracedBuffer {
/** Sets the callback function to call when timestamps for a write are /** Sets the callback function to call when timestamps for a write are
* collected. The callback does not own a reference to error. */ * collected. The callback does not own a reference to error. */
void grpc_tcp_set_write_timestamps_callback( void grpc_tcp_set_write_timestamps_callback(
void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)); void (*fn)(void*, Timestamps*, grpc_error_handle error));
} /* namespace grpc_core */ } /* namespace grpc_core */

@ -91,8 +91,7 @@ void CallCombiner::TsanClosure(void* arg, grpc_error_handle error) {
} else { } else {
lock.reset(); lock.reset();
} }
grpc_core::Closure::Run(DEBUG_LOCATION, self->original_closure_, Closure::Run(DEBUG_LOCATION, self->original_closure_, GRPC_ERROR_REF(error));
GRPC_ERROR_REF(error));
if (lock != nullptr) { if (lock != nullptr) {
TSAN_ANNOTATE_RWLOCK_RELEASED(&lock->taken, true); TSAN_ANNOTATE_RWLOCK_RELEASED(&lock->taken, true);
bool prev = true; bool prev = true;

@ -73,10 +73,10 @@ class Combiner;
* Generally, to create an exec_ctx instance, add the following line at the top * Generally, to create an exec_ctx instance, add the following line at the top
* of the public API entry point or at the start of a thread's work function : * of the public API entry point or at the start of a thread's work function :
* *
* grpc_core::ExecCtx exec_ctx; * ExecCtx exec_ctx;
* *
* Access the created ExecCtx instance using : * Access the created ExecCtx instance using :
* grpc_core::ExecCtx::Get() * ExecCtx::Get()
* *
* Specific responsibilities (this may grow in the future): * Specific responsibilities (this may grow in the future):
* - track a list of core work that needs to be delayed until the base of the * - track a list of core work that needs to be delayed until the base of the
@ -90,7 +90,7 @@ class Combiner;
* - Instance of this must ALWAYS be constructed on the stack, never * - Instance of this must ALWAYS be constructed on the stack, never
* heap allocated. * heap allocated.
* - Do not pass exec_ctx as a parameter to a function. Always access it using * - Do not pass exec_ctx as a parameter to a function. Always access it using
* grpc_core::ExecCtx::Get(). * ExecCtx::Get().
* - NOTE: In the future, the convention is likely to change to allow only one * - NOTE: In the future, the convention is likely to change to allow only one
* ExecCtx on a thread's stack at the same time. The TODO below * ExecCtx on a thread's stack at the same time. The TODO below
* discusses this plan in more detail. * discusses this plan in more detail.
@ -108,14 +108,14 @@ class ExecCtx {
/** Default Constructor */ /** Default Constructor */
ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) { ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) {
grpc_core::Fork::IncExecCtxCount(); Fork::IncExecCtxCount();
Set(this); Set(this);
} }
/** Parameterised Constructor */ /** Parameterised Constructor */
explicit ExecCtx(uintptr_t fl) : flags_(fl) { explicit ExecCtx(uintptr_t fl) : flags_(fl) {
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
grpc_core::Fork::IncExecCtxCount(); Fork::IncExecCtxCount();
} }
Set(this); Set(this);
} }
@ -126,7 +126,7 @@ class ExecCtx {
Flush(); Flush();
Set(last_exec_ctx_); Set(last_exec_ctx_);
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
grpc_core::Fork::DecExecCtxCount(); Fork::DecExecCtxCount();
} }
} }
@ -276,7 +276,7 @@ class ExecCtx {
* stacks of core re-entries. Instead, any application callbacks instead should * stacks of core re-entries. Instead, any application callbacks instead should
* not be invoked until other core work is done and other application callbacks * not be invoked until other core work is done and other application callbacks
* have completed. To accomplish this, any application callback should be * have completed. To accomplish this, any application callback should be
* enqueued using grpc_core::ApplicationCallbackExecCtx::Enqueue . * enqueued using ApplicationCallbackExecCtx::Enqueue .
* *
* CONVENTIONS: * CONVENTIONS:
* - Instances of this must ALWAYS be constructed on the stack, never * - Instances of this must ALWAYS be constructed on the stack, never
@ -289,8 +289,8 @@ class ExecCtx {
* Generally, core entry points that may trigger application-level callbacks * Generally, core entry points that may trigger application-level callbacks
* will have the following declarations: * will have the following declarations:
* *
* grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; * ApplicationCallbackExecCtx callback_exec_ctx;
* grpc_core::ExecCtx exec_ctx; * ExecCtx exec_ctx;
* *
* This ordering is important to make sure that the ApplicationCallbackExecCtx * This ordering is important to make sure that the ApplicationCallbackExecCtx
* is destroyed after the ExecCtx (to prevent the re-entry problem described * is destroyed after the ExecCtx (to prevent the re-entry problem described
@ -320,7 +320,7 @@ class ApplicationCallbackExecCtx {
} }
callback_exec_ctx_ = nullptr; callback_exec_ctx_ = nullptr;
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
grpc_core::Fork::DecExecCtxCount(); Fork::DecExecCtxCount();
} }
} else { } else {
GPR_DEBUG_ASSERT(head_ == nullptr); GPR_DEBUG_ASSERT(head_ == nullptr);
@ -335,7 +335,7 @@ class ApplicationCallbackExecCtx {
static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) { static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) {
if (Get() == nullptr) { if (Get() == nullptr) {
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) { if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) {
grpc_core::Fork::IncExecCtxCount(); Fork::IncExecCtxCount();
} }
callback_exec_ctx_ = exec_ctx; callback_exec_ctx_ = exec_ctx;
} }

@ -108,7 +108,7 @@ size_t Executor::RunClosures(const char* executor_name,
// invoked on its destruction, which will be after completing any closures in // invoked on its destruction, which will be after completing any closures in
// the executor's closure list (which were explicitly scheduled onto the // the executor's closure list (which were explicitly scheduled onto the
// executor). // executor).
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx( ApplicationCallbackExecCtx callback_exec_ctx(
GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD); GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
grpc_closure* c = list.head; grpc_closure* c = list.head;
@ -126,7 +126,7 @@ size_t Executor::RunClosures(const char* executor_name,
GRPC_ERROR_UNREF(error); GRPC_ERROR_UNREF(error);
c = next; c = next;
n++; n++;
grpc_core::ExecCtx::Get()->Flush(); ExecCtx::Get()->Flush();
} }
return n; return n;
@ -156,12 +156,11 @@ void Executor::SetThreading(bool threading) {
gpr_cv_init(&thd_state_[i].cv); gpr_cv_init(&thd_state_[i].cv);
thd_state_[i].id = i; thd_state_[i].id = i;
thd_state_[i].name = name_; thd_state_[i].name = name_;
thd_state_[i].thd = grpc_core::Thread(); thd_state_[i].thd = Thread();
thd_state_[i].elems = GRPC_CLOSURE_LIST_INIT; thd_state_[i].elems = GRPC_CLOSURE_LIST_INIT;
} }
thd_state_[0].thd = thd_state_[0].thd = Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
grpc_core::Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
thd_state_[0].thd.Start(); thd_state_[0].thd.Start();
} else { // !threading } else { // !threading
if (curr_num_threads == 0) { if (curr_num_threads == 0) {
@ -202,7 +201,7 @@ void Executor::SetThreading(bool threading) {
// finish. Thus, never call Executor::SetThreading(false) in the middle of // finish. Thus, never call Executor::SetThreading(false) in the middle of
// an application. // an application.
// TODO(guantaol): create another method to finish all the pending closures // TODO(guantaol): create another method to finish all the pending closures
// registered in the background poller by grpc_core::Executor. // registered in the background poller by Executor.
grpc_iomgr_platform_shutdown_background_closure(); grpc_iomgr_platform_shutdown_background_closure();
} }
@ -215,7 +214,7 @@ void Executor::ThreadMain(void* arg) {
ThreadState* ts = static_cast<ThreadState*>(arg); ThreadState* ts = static_cast<ThreadState*>(arg);
g_this_thread_state = ts; g_this_thread_state = ts;
grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD); ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
size_t subtract_depth = 0; size_t subtract_depth = 0;
for (;;) { for (;;) {
@ -242,7 +241,7 @@ void Executor::ThreadMain(void* arg) {
EXECUTOR_TRACE("(%s) [%" PRIdPTR "]: execute", ts->name, ts->id); EXECUTOR_TRACE("(%s) [%" PRIdPTR "]: execute", ts->name, ts->id);
grpc_core::ExecCtx::Get()->InvalidateNow(); ExecCtx::Get()->InvalidateNow();
subtract_depth = RunClosures(ts->name, closures); subtract_depth = RunClosures(ts->name, closures);
} }
@ -267,8 +266,7 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
#else #else
EXECUTOR_TRACE("(%s) schedule %p inline", name_, closure); EXECUTOR_TRACE("(%s) schedule %p inline", name_, closure);
#endif #endif
grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), grpc_closure_list_append(ExecCtx::Get()->closure_list(), closure, error);
closure, error);
return; return;
} }
@ -278,8 +276,7 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
ThreadState* ts = g_this_thread_state; ThreadState* ts = g_this_thread_state;
if (ts == nullptr) { if (ts == nullptr) {
ts = &thd_state_[grpc_core::HashPointer(grpc_core::ExecCtx::Get(), ts = &thd_state_[HashPointer(ExecCtx::Get(), cur_thread_count)];
cur_thread_count)];
} }
ThreadState* orig_ts = ts; ThreadState* orig_ts = ts;
@ -356,8 +353,8 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
// always increment num_threads under the 'adding_thread_lock') // always increment num_threads under the 'adding_thread_lock')
gpr_atm_rel_store(&num_threads_, cur_thread_count + 1); gpr_atm_rel_store(&num_threads_, cur_thread_count + 1);
thd_state_[cur_thread_count].thd = grpc_core::Thread( thd_state_[cur_thread_count].thd =
name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]); Thread(name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]);
thd_state_[cur_thread_count].thd.Start(); thd_state_[cur_thread_count].thd.Start();
} }
gpr_spinlock_unlock(&adding_thread_lock_); gpr_spinlock_unlock(&adding_thread_lock_);

@ -36,7 +36,7 @@ struct ThreadState {
size_t depth; // Number of closures in the closure list size_t depth; // Number of closures in the closure list
bool shutdown; bool shutdown;
bool queued_long_job; bool queued_long_job;
grpc_core::Thread thd; Thread thd;
}; };
enum class ExecutorType { enum class ExecutorType {

@ -26,17 +26,14 @@ DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer");
class WorkSerializer::WorkSerializerImpl : public Orphanable { class WorkSerializer::WorkSerializerImpl : public Orphanable {
public: public:
void Run(std::function<void()> callback, void Run(std::function<void()> callback, const DebugLocation& location);
const grpc_core::DebugLocation& location); void Schedule(std::function<void()> callback, const DebugLocation& location);
void Schedule(std::function<void()> callback,
const grpc_core::DebugLocation& location);
void DrainQueue(); void DrainQueue();
void Orphan() override; void Orphan() override;
private: private:
struct CallbackWrapper { struct CallbackWrapper {
CallbackWrapper(std::function<void()> cb, CallbackWrapper(std::function<void()> cb, const DebugLocation& loc)
const grpc_core::DebugLocation& loc)
: callback(std::move(cb)), location(loc) {} : callback(std::move(cb)), location(loc) {}
MultiProducerSingleConsumerQueue::Node mpscq_node; MultiProducerSingleConsumerQueue::Node mpscq_node;
@ -75,8 +72,8 @@ class WorkSerializer::WorkSerializerImpl : public Orphanable {
MultiProducerSingleConsumerQueue queue_; MultiProducerSingleConsumerQueue queue_;
}; };
void WorkSerializer::WorkSerializerImpl::Run( void WorkSerializer::WorkSerializerImpl::Run(std::function<void()> callback,
std::function<void()> callback, const grpc_core::DebugLocation& location) { const DebugLocation& location) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]", gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]",
this, location.file(), location.line()); this, location.file(), location.line());
@ -108,7 +105,7 @@ void WorkSerializer::WorkSerializerImpl::Run(
} }
void WorkSerializer::WorkSerializerImpl::Schedule( void WorkSerializer::WorkSerializerImpl::Schedule(
std::function<void()> callback, const grpc_core::DebugLocation& location) { std::function<void()> callback, const DebugLocation& location) {
CallbackWrapper* cb_wrapper = CallbackWrapper* cb_wrapper =
new CallbackWrapper(std::move(callback), location); new CallbackWrapper(std::move(callback), location);
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
@ -215,12 +212,12 @@ WorkSerializer::WorkSerializer()
WorkSerializer::~WorkSerializer() {} WorkSerializer::~WorkSerializer() {}
void WorkSerializer::Run(std::function<void()> callback, void WorkSerializer::Run(std::function<void()> callback,
const grpc_core::DebugLocation& location) { const DebugLocation& location) {
impl_->Run(std::move(callback), location); impl_->Run(std::move(callback), location);
} }
void WorkSerializer::Schedule(std::function<void()> callback, void WorkSerializer::Schedule(std::function<void()> callback,
const grpc_core::DebugLocation& location) { const DebugLocation& location) {
impl_->Schedule(std::move(callback), location); impl_->Schedule(std::move(callback), location);
} }

@ -72,15 +72,13 @@ class ABSL_LOCKABLE WorkSerializer {
// } // }
// void callback() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer) { ... } // void callback() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer) { ... }
// //
// TODO(yashkt): Replace grpc_core::DebugLocation with absl::SourceLocation // TODO(yashkt): Replace DebugLocation with absl::SourceLocation
// once we can start using it directly. // once we can start using it directly.
void Run(std::function<void()> callback, void Run(std::function<void()> callback, const DebugLocation& location);
const grpc_core::DebugLocation& location);
// Schedule \a callback to be run later when the queue of callbacks is // Schedule \a callback to be run later when the queue of callbacks is
// drained. // drained.
void Schedule(std::function<void()> callback, void Schedule(std::function<void()> callback, const DebugLocation& location);
const grpc_core::DebugLocation& location);
// Drains the queue of callbacks. // Drains the queue of callbacks.
void DrainQueue(); void DrainQueue();

@ -30,7 +30,7 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
if (field.type() != Json::Type::STRING) return false; if (field.type() != Json::Type::STRING) return false;
size_t len = field.string_value().size(); size_t len = field.string_value().size();
if (field.string_value()[len - 1] != 's') return false; if (field.string_value()[len - 1] != 's') return false;
grpc_core::UniquePtr<char> buf(gpr_strdup(field.string_value().c_str())); UniquePtr<char> buf(gpr_strdup(field.string_value().c_str()));
*(buf.get() + len - 1) = '\0'; // Remove trailing 's'. *(buf.get() + len - 1) = '\0'; // Remove trailing 's'.
char* decimal_point = strchr(buf.get(), '.'); char* decimal_point = strchr(buf.get(), '.');
int nanos = 0; int nanos = 0;

@ -110,7 +110,7 @@ FileWatcherAuthorizationPolicyProvider::FileWatcherAuthorizationPolicyProvider(
} }
} }
}; };
refresh_thread_ = absl::make_unique<grpc_core::Thread>( refresh_thread_ = absl::make_unique<Thread>(
"FileWatcherAuthorizationPolicyProvider_refreshing_thread", thread_lambda, "FileWatcherAuthorizationPolicyProvider_refreshing_thread", thread_lambda,
WeakRef().release()); WeakRef().release());
refresh_thread_->Start(); refresh_thread_->Start();
@ -130,7 +130,7 @@ absl::Status FileWatcherAuthorizationPolicyProvider::ForceUpdate() {
if (!rbac_policies_or.ok()) { if (!rbac_policies_or.ok()) {
return rbac_policies_or.status(); return rbac_policies_or.status();
} }
grpc_core::MutexLock lock(&mu_); MutexLock lock(&mu_);
allow_engine_ = MakeRefCounted<GrpcAuthorizationEngine>( allow_engine_ = MakeRefCounted<GrpcAuthorizationEngine>(
std::move(rbac_policies_or->allow_policy)); std::move(rbac_policies_or->allow_policy));
deny_engine_ = MakeRefCounted<GrpcAuthorizationEngine>( deny_engine_ = MakeRefCounted<GrpcAuthorizationEngine>(

@ -77,7 +77,7 @@ class FileWatcherAuthorizationPolicyProvider
void Orphan() override; void Orphan() override;
AuthorizationEngines engines() override { AuthorizationEngines engines() override {
grpc_core::MutexLock lock(&mu_); MutexLock lock(&mu_);
return {allow_engine_, deny_engine_}; return {allow_engine_, deny_engine_};
} }
@ -92,7 +92,7 @@ class FileWatcherAuthorizationPolicyProvider
std::unique_ptr<Thread> refresh_thread_; std::unique_ptr<Thread> refresh_thread_;
gpr_event shutdown_event_; gpr_event shutdown_event_;
grpc_core::Mutex mu_; Mutex mu_;
// Engines created using authz_policy_. // Engines created using authz_policy_.
RefCountedPtr<AuthorizationEngine> allow_engine_ ABSL_GUARDED_BY(mu_); RefCountedPtr<AuthorizationEngine> allow_engine_ ABSL_GUARDED_BY(mu_);
RefCountedPtr<AuthorizationEngine> deny_engine_ ABSL_GUARDED_BY(mu_); RefCountedPtr<AuthorizationEngine> deny_engine_ ABSL_GUARDED_BY(mu_);

@ -439,9 +439,9 @@ void set_gce_tenancy_checker_for_testing(grpc_gce_tenancy_checker checker) {
} }
void grpc_flush_cached_google_default_credentials(void) { void grpc_flush_cached_google_default_credentials(void) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
gpr_once_init(&g_once, init_default_credentials); gpr_once_init(&g_once, init_default_credentials);
grpc_core::MutexLock lock(g_state_mu); MutexLock lock(g_state_mu);
g_metadata_server_available = 0; g_metadata_server_available = 0;
} }

@ -182,7 +182,7 @@ grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
namespace grpc_core { namespace grpc_core {
absl::StatusOr<std::string> RemoveServiceNameFromJwtUri(absl::string_view uri) { absl::StatusOr<std::string> RemoveServiceNameFromJwtUri(absl::string_view uri) {
auto parsed = grpc_core::URI::Parse(uri); auto parsed = URI::Parse(uri);
if (!parsed.ok()) { if (!parsed.ok()) {
return parsed.status(); return parsed.status();
} }

@ -584,8 +584,8 @@ class StsTokenFetcherCredentials
channel. This would allow us to cancel an authentication query when under channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */ extreme memory pressure. */
grpc_httpcli_post( grpc_httpcli_post(
http_context, pollent, grpc_core::ResourceQuota::Default(), &request, http_context, pollent, ResourceQuota::Default(), &request, body,
body, body_length, deadline, body_length, deadline,
GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req, GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req,
grpc_schedule_on_exec_ctx), grpc_schedule_on_exec_ctx),
&metadata_req->response); &metadata_req->response);
@ -636,14 +636,14 @@ class StsTokenFetcherCredentials
URI sts_url_; URI sts_url_;
grpc_closure http_post_cb_closure_; grpc_closure http_post_cb_closure_;
grpc_core::UniquePtr<char> resource_; UniquePtr<char> resource_;
grpc_core::UniquePtr<char> audience_; UniquePtr<char> audience_;
grpc_core::UniquePtr<char> scope_; UniquePtr<char> scope_;
grpc_core::UniquePtr<char> requested_token_type_; UniquePtr<char> requested_token_type_;
grpc_core::UniquePtr<char> subject_token_path_; UniquePtr<char> subject_token_path_;
grpc_core::UniquePtr<char> subject_token_type_; UniquePtr<char> subject_token_type_;
grpc_core::UniquePtr<char> actor_token_path_; UniquePtr<char> actor_token_path_;
grpc_core::UniquePtr<char> actor_token_type_; UniquePtr<char> actor_token_type_;
}; };
} // namespace } // namespace

@ -31,17 +31,16 @@
namespace grpc_core { namespace grpc_core {
StaticDataCertificateProvider::StaticDataCertificateProvider( StaticDataCertificateProvider::StaticDataCertificateProvider(
std::string root_certificate, std::string root_certificate, PemKeyCertPairList pem_key_cert_pairs)
grpc_core::PemKeyCertPairList pem_key_cert_pairs)
: distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()), : distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()),
root_certificate_(std::move(root_certificate)), root_certificate_(std::move(root_certificate)),
pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) { pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) {
distributor_->SetWatchStatusCallback([this](std::string cert_name, distributor_->SetWatchStatusCallback([this](std::string cert_name,
bool root_being_watched, bool root_being_watched,
bool identity_being_watched) { bool identity_being_watched) {
grpc_core::MutexLock lock(&mu_); MutexLock lock(&mu_);
absl::optional<std::string> root_certificate; absl::optional<std::string> root_certificate;
absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs; absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name]; StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched && if (!info.root_being_watched && root_being_watched &&
!root_certificate_.empty()) { !root_certificate_.empty()) {
@ -123,15 +122,15 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
provider->ForceUpdate(); provider->ForceUpdate();
} }
}; };
refresh_thread_ = grpc_core::Thread( refresh_thread_ = Thread("FileWatcherCertificateProvider_refreshing_thread",
"FileWatcherCertificateProvider_refreshing_thread", thread_lambda, this); thread_lambda, this);
refresh_thread_.Start(); refresh_thread_.Start();
distributor_->SetWatchStatusCallback([this](std::string cert_name, distributor_->SetWatchStatusCallback([this](std::string cert_name,
bool root_being_watched, bool root_being_watched,
bool identity_being_watched) { bool identity_being_watched) {
grpc_core::MutexLock lock(&mu_); MutexLock lock(&mu_);
absl::optional<std::string> root_certificate; absl::optional<std::string> root_certificate;
absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs; absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
FileWatcherCertificateProvider::WatcherInfo& info = FileWatcherCertificateProvider::WatcherInfo& info =
watcher_info_[cert_name]; watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched && if (!info.root_being_watched && root_being_watched &&
@ -180,7 +179,7 @@ FileWatcherCertificateProvider::~FileWatcherCertificateProvider() {
void FileWatcherCertificateProvider::ForceUpdate() { void FileWatcherCertificateProvider::ForceUpdate() {
absl::optional<std::string> root_certificate; absl::optional<std::string> root_certificate;
absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs; absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
if (!root_cert_path_.empty()) { if (!root_cert_path_.empty()) {
root_certificate = ReadRootCertificatesFromFile(root_cert_path_); root_certificate = ReadRootCertificatesFromFile(root_cert_path_);
} }
@ -188,7 +187,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
pem_key_cert_pairs = ReadIdentityKeyCertPairFromFiles( pem_key_cert_pairs = ReadIdentityKeyCertPairFromFiles(
private_key_path_, identity_certificate_path_); private_key_path_, identity_certificate_path_);
} }
grpc_core::MutexLock lock(&mu_); MutexLock lock(&mu_);
const bool root_cert_changed = const bool root_cert_changed =
(!root_certificate.has_value() && !root_certificate_.empty()) || (!root_certificate.has_value() && !root_certificate_.empty()) ||
(root_certificate.has_value() && root_certificate_ != *root_certificate); (root_certificate.has_value() && root_certificate_ != *root_certificate);
@ -221,7 +220,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
const std::string& cert_name = p.first; const std::string& cert_name = p.first;
const WatcherInfo& info = p.second; const WatcherInfo& info = p.second;
absl::optional<std::string> root_to_report; absl::optional<std::string> root_to_report;
absl::optional<grpc_core::PemKeyCertPairList> identity_to_report; absl::optional<PemKeyCertPairList> identity_to_report;
// Set key materials to the distributor if their contents changed. // Set key materials to the distributor if their contents changed.
if (info.root_being_watched && !root_certificate_.empty() && if (info.root_being_watched && !root_certificate_.empty() &&
root_cert_changed) { root_cert_changed) {
@ -279,7 +278,7 @@ namespace {
// it logs the error and returns 0. // it logs the error and returns 0.
time_t GetModificationTime(const char* filename) { time_t GetModificationTime(const char* filename) {
time_t ts = 0; time_t ts = 0;
absl::Status status = grpc_core::GetFileModificationTime(filename, &ts); absl::Status status = GetFileModificationTime(filename, &ts);
return ts; return ts;
} }

@ -59,9 +59,8 @@ namespace grpc_core {
class StaticDataCertificateProvider final class StaticDataCertificateProvider final
: public grpc_tls_certificate_provider { : public grpc_tls_certificate_provider {
public: public:
StaticDataCertificateProvider( StaticDataCertificateProvider(std::string root_certificate,
std::string root_certificate, PemKeyCertPairList pem_key_cert_pairs);
grpc_core::PemKeyCertPairList pem_key_cert_pairs);
~StaticDataCertificateProvider() override; ~StaticDataCertificateProvider() override;
@ -76,9 +75,9 @@ class StaticDataCertificateProvider final
}; };
RefCountedPtr<grpc_tls_certificate_distributor> distributor_; RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
std::string root_certificate_; std::string root_certificate_;
grpc_core::PemKeyCertPairList pem_key_cert_pairs_; PemKeyCertPairList pem_key_cert_pairs_;
// Guards members below. // Guards members below.
grpc_core::Mutex mu_; Mutex mu_;
// Stores each cert_name we get from the distributor callback and its watcher // Stores each cert_name we get from the distributor callback and its watcher
// information. // information.
std::map<std::string, WatcherInfo> watcher_info_; std::map<std::string, WatcherInfo> watcher_info_;
@ -122,15 +121,15 @@ class FileWatcherCertificateProvider final
unsigned int refresh_interval_sec_ = 0; unsigned int refresh_interval_sec_ = 0;
RefCountedPtr<grpc_tls_certificate_distributor> distributor_; RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
grpc_core::Thread refresh_thread_; Thread refresh_thread_;
gpr_event shutdown_event_; gpr_event shutdown_event_;
// Guards members below. // Guards members below.
grpc_core::Mutex mu_; Mutex mu_;
// The most-recent credential data. It will be empty if the most recent read // The most-recent credential data. It will be empty if the most recent read
// attempt failed. // attempt failed.
std::string root_certificate_ ABSL_GUARDED_BY(mu_); std::string root_certificate_ ABSL_GUARDED_BY(mu_);
grpc_core::PemKeyCertPairList pem_key_cert_pairs_ ABSL_GUARDED_BY(mu_); PemKeyCertPairList pem_key_cert_pairs_ ABSL_GUARDED_BY(mu_);
// Stores each cert_name we get from the distributor callback and its watcher // Stores each cert_name we get from the distributor callback and its watcher
// information. // information.
std::map<std::string, WatcherInfo> watcher_info_ ABSL_GUARDED_BY(mu_); std::map<std::string, WatcherInfo> watcher_info_ ABSL_GUARDED_BY(mu_);

@ -187,8 +187,8 @@ class grpc_alts_server_security_connector final
namespace grpc_core { namespace grpc_core {
namespace internal { namespace internal {
grpc_core::RefCountedPtr<grpc_auth_context> RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) { const tsi_peer* peer) {
if (peer == nullptr) { if (peer == nullptr) {
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"Invalid arguments to grpc_alts_auth_context_from_tsi_peer()"); "Invalid arguments to grpc_alts_auth_context_from_tsi_peer()");
@ -243,7 +243,7 @@ grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
return nullptr; return nullptr;
} }
/* Create auth context. */ /* Create auth context. */
auto ctx = grpc_core::MakeRefCounted<grpc_auth_context>(nullptr); auto ctx = MakeRefCounted<grpc_auth_context>(nullptr);
grpc_auth_context_add_cstring_property( grpc_auth_context_add_cstring_property(
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME, ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_ALTS_TRANSPORT_SECURITY_TYPE); GRPC_ALTS_TRANSPORT_SECURITY_TYPE);

@ -66,8 +66,8 @@ namespace grpc_core {
namespace internal { namespace internal {
/* Exposed only for testing. */ /* Exposed only for testing. */
grpc_core::RefCountedPtr<grpc_auth_context> RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer); const tsi_peer* peer);
} // namespace internal } // namespace internal
} // namespace grpc_core } // namespace grpc_core

@ -95,7 +95,7 @@ int InsecureChannelSecurityConnector::cmp(
// created with the security level of TSI_SECURITY_NONE. // created with the security level of TSI_SECURITY_NONE.
void InsecureServerSecurityConnector::add_handshakers( void InsecureServerSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */, const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */,
grpc_core::HandshakeManager* handshake_manager) { HandshakeManager* handshake_manager) {
tsi_handshaker* handshaker = nullptr; tsi_handshaker* handshaker = nullptr;
// Re-use local_tsi_handshaker_create as a minimalist handshaker. // Re-use local_tsi_handshaker_create as a minimalist handshaker.
GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */, &handshaker) == GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */, &handshaker) ==
@ -105,7 +105,7 @@ void InsecureServerSecurityConnector::add_handshakers(
void InsecureServerSecurityConnector::check_peer( void InsecureServerSecurityConnector::check_peer(
tsi_peer peer, grpc_endpoint* /*ep*/, tsi_peer peer, grpc_endpoint* /*ep*/,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context, RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) { grpc_closure* on_peer_checked) {
*auth_context = MakeAuthContext(); *auth_context = MakeAuthContext();
tsi_peer_destruct(&peer); tsi_peer_destruct(&peer);

@ -39,8 +39,8 @@ class InsecureChannelSecurityConnector
: public grpc_channel_security_connector { : public grpc_channel_security_connector {
public: public:
InsecureChannelSecurityConnector( InsecureChannelSecurityConnector(
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds, RefCountedPtr<grpc_channel_credentials> channel_creds,
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds) RefCountedPtr<grpc_call_credentials> request_metadata_creds)
: grpc_channel_security_connector(/* url_scheme */ nullptr, : grpc_channel_security_connector(/* url_scheme */ nullptr,
std::move(channel_creds), std::move(channel_creds),
std::move(request_metadata_creds)) {} std::move(request_metadata_creds)) {}
@ -54,10 +54,10 @@ class InsecureChannelSecurityConnector
void add_handshakers(const grpc_channel_args* args, void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */, grpc_pollset_set* /* interested_parties */,
grpc_core::HandshakeManager* handshake_manager) override; HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep, void check_peer(tsi_peer peer, grpc_endpoint* ep,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context, RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override; grpc_closure* on_peer_checked) override;
void cancel_check_peer(grpc_closure* /*on_peer_checked*/, void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
@ -71,16 +71,16 @@ class InsecureChannelSecurityConnector
class InsecureServerSecurityConnector : public grpc_server_security_connector { class InsecureServerSecurityConnector : public grpc_server_security_connector {
public: public:
explicit InsecureServerSecurityConnector( explicit InsecureServerSecurityConnector(
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds) RefCountedPtr<grpc_server_credentials> server_creds)
: grpc_server_security_connector(nullptr /* url_scheme */, : grpc_server_security_connector(nullptr /* url_scheme */,
std::move(server_creds)) {} std::move(server_creds)) {}
void add_handshakers(const grpc_channel_args* args, void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */, grpc_pollset_set* /* interested_parties */,
grpc_core::HandshakeManager* handshake_manager) override; HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep, void check_peer(tsi_peer peer, grpc_endpoint* ep,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context, RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override; grpc_closure* on_peer_checked) override;
void cancel_check_peer(grpc_closure* /*on_peer_checked*/, void cancel_check_peer(grpc_closure* /*on_peer_checked*/,

@ -145,8 +145,7 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
grpc_slice LoadSystemRootCerts() { grpc_slice LoadSystemRootCerts() {
grpc_slice result = grpc_empty_slice(); grpc_slice result = grpc_empty_slice();
// Prioritize user-specified custom directory if flag is set. // Prioritize user-specified custom directory if flag is set.
grpc_core::UniquePtr<char> custom_dir = UniquePtr<char> custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
if (strlen(custom_dir.get()) > 0) { if (strlen(custom_dir.get()) > 0) {
result = CreateRootCertsBundle(custom_dir.get()); result = CreateRootCertsBundle(custom_dir.get());
} }

@ -563,7 +563,7 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
const bool not_use_system_roots = const bool not_use_system_roots =
GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots); GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots);
// First try to load the roots from the configuration. // First try to load the roots from the configuration.
grpc_core::UniquePtr<char> default_root_certs_path = UniquePtr<char> default_root_certs_path =
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path); GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
if (strlen(default_root_certs_path.get()) > 0) { if (strlen(default_root_certs_path.get()) > 0) {
GRPC_LOG_IF_ERROR( GRPC_LOG_IF_ERROR(

@ -181,7 +181,7 @@ class PemKeyCertPair {
std::string cert_chain_; std::string cert_chain_;
}; };
typedef absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList; typedef absl::InlinedVector<PemKeyCertPair, 1> PemKeyCertPairList;
} // namespace grpc_core } // namespace grpc_core

@ -440,7 +440,7 @@ grpc_error_handle SecurityHandshaker::DoHandshakerNextLocked(
void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler( void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler(
void* arg, grpc_error_handle error) { void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg); SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
grpc_core::ExecCtx::Run( ExecCtx::Run(
DEBUG_LOCATION, DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_received_from_peer_, GRPC_CLOSURE_INIT(&h->on_handshake_data_received_from_peer_,
&SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn, &SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn,
@ -473,7 +473,7 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(
void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler( void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler(
void* arg, grpc_error_handle error) { void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg); SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
grpc_core::ExecCtx::Run( ExecCtx::Run(
DEBUG_LOCATION, DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer_, GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer_,
&SecurityHandshaker::OnHandshakeDataSentToPeerFn, h, &SecurityHandshaker::OnHandshakeDataSentToPeerFn, h,

@ -139,7 +139,7 @@ class NewWithLenSliceRefcount {
/** grpc_slice_from_moved_(string|buffer) ref count .*/ /** grpc_slice_from_moved_(string|buffer) ref count .*/
class MovedStringSliceRefCount { class MovedStringSliceRefCount {
public: public:
explicit MovedStringSliceRefCount(grpc_core::UniquePtr<char>&& str) explicit MovedStringSliceRefCount(UniquePtr<char>&& str)
: base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this, : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
&base_), &base_),
str_(std::move(str)) {} str_(std::move(str)) {}
@ -152,8 +152,8 @@ class MovedStringSliceRefCount {
} }
grpc_slice_refcount base_; grpc_slice_refcount base_;
grpc_core::RefCount refs_; RefCount refs_;
grpc_core::UniquePtr<char> str_; UniquePtr<char> str_;
}; };
// grpc_slice_from_cpp_string() ref count. // grpc_slice_from_cpp_string() ref count.
@ -172,7 +172,7 @@ class MovedCppStringSliceRefCount {
} }
grpc_slice_refcount base_; grpc_slice_refcount base_;
grpc_core::RefCount refs_; RefCount refs_;
std::string str_; std::string str_;
}; };

@ -130,7 +130,7 @@ const uint8_t g_static_metadata_bytes[] = {
97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116,
121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112};
grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount; grpc_slice_refcount StaticSliceRefcount::kStaticSubRefcount;
StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] = StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] =
{ {
@ -195,335 +195,225 @@ StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] =
const StaticMetadataSlice const StaticMetadataSlice
g_static_metadata_slice_table[GRPC_STATIC_MDSTR_COUNT] = { g_static_metadata_slice_table[GRPC_STATIC_MDSTR_COUNT] = {
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
&g_static_metadata_slice_refcounts[0].base, 5,
g_static_metadata_bytes + 0), g_static_metadata_bytes + 0),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5), g_static_metadata_bytes + 5),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10,
&g_static_metadata_slice_refcounts[3].base, 10,
g_static_metadata_bytes + 19), g_static_metadata_bytes + 19),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29), g_static_metadata_bytes + 29),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 12,
&g_static_metadata_slice_refcounts[5].base, 12,
g_static_metadata_bytes + 36), g_static_metadata_bytes + 36),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48), g_static_metadata_bytes + 48),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 16,
&g_static_metadata_slice_refcounts[7].base, 16,
g_static_metadata_bytes + 59), g_static_metadata_bytes + 59),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75), g_static_metadata_bytes + 75),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 21,
&g_static_metadata_slice_refcounts[10].base, 21,
g_static_metadata_bytes + 108), g_static_metadata_bytes + 108),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[11].base, 13,
&g_static_metadata_slice_refcounts[11].base, 13,
g_static_metadata_bytes + 129), g_static_metadata_bytes + 129),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[12].base, 14,
&g_static_metadata_slice_refcounts[12].base, 14,
g_static_metadata_bytes + 142), g_static_metadata_bytes + 142),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156), g_static_metadata_bytes + 156),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168), g_static_metadata_bytes + 168),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 30,
&g_static_metadata_slice_refcounts[16].base, 30,
g_static_metadata_bytes + 199), g_static_metadata_bytes + 199),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 37,
&g_static_metadata_slice_refcounts[17].base, 37,
g_static_metadata_bytes + 229), g_static_metadata_bytes + 229),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 10,
&g_static_metadata_slice_refcounts[18].base, 10,
g_static_metadata_bytes + 266), g_static_metadata_bytes + 266),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 4,
&g_static_metadata_slice_refcounts[19].base, 4,
g_static_metadata_bytes + 276), g_static_metadata_bytes + 276),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[20].base, 26,
&g_static_metadata_slice_refcounts[20].base, 26,
g_static_metadata_bytes + 280), g_static_metadata_bytes + 280),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[21].base, 22,
&g_static_metadata_slice_refcounts[21].base, 22,
g_static_metadata_bytes + 306), g_static_metadata_bytes + 306),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 27,
&g_static_metadata_slice_refcounts[22].base, 27,
g_static_metadata_bytes + 328), g_static_metadata_bytes + 328),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 12,
&g_static_metadata_slice_refcounts[23].base, 12,
g_static_metadata_bytes + 355), g_static_metadata_bytes + 355),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1,
&g_static_metadata_slice_refcounts[24].base, 1,
g_static_metadata_bytes + 367), g_static_metadata_bytes + 367),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 1,
&g_static_metadata_slice_refcounts[25].base, 1,
g_static_metadata_bytes + 368), g_static_metadata_bytes + 368),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 1,
&g_static_metadata_slice_refcounts[26].base, 1,
g_static_metadata_bytes + 369), g_static_metadata_bytes + 369),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 1,
&g_static_metadata_slice_refcounts[27].base, 1,
g_static_metadata_bytes + 370), g_static_metadata_bytes + 370),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[29].base, 19,
&g_static_metadata_slice_refcounts[29].base, 19,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[30].base, 12,
&g_static_metadata_slice_refcounts[30].base, 12,
g_static_metadata_bytes + 390), g_static_metadata_bytes + 390),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 30,
&g_static_metadata_slice_refcounts[31].base, 30,
g_static_metadata_bytes + 402), g_static_metadata_bytes + 402),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 31,
&g_static_metadata_slice_refcounts[32].base, 31,
g_static_metadata_bytes + 432), g_static_metadata_bytes + 432),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 36,
&g_static_metadata_slice_refcounts[33].base, 36,
g_static_metadata_bytes + 463), g_static_metadata_bytes + 463),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 65,
&g_static_metadata_slice_refcounts[34].base, 65,
g_static_metadata_bytes + 499), g_static_metadata_bytes + 499),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 65,
&g_static_metadata_slice_refcounts[35].base, 65,
g_static_metadata_bytes + 564), g_static_metadata_bytes + 564),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 28,
&g_static_metadata_slice_refcounts[36].base, 28,
g_static_metadata_bytes + 629), g_static_metadata_bytes + 629),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 80,
&g_static_metadata_slice_refcounts[37].base, 80,
g_static_metadata_bytes + 657), g_static_metadata_bytes + 657),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 80,
&g_static_metadata_slice_refcounts[38].base, 80,
g_static_metadata_bytes + 737), g_static_metadata_bytes + 737),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7,
&g_static_metadata_slice_refcounts[39].base, 7,
g_static_metadata_bytes + 817), g_static_metadata_bytes + 817),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 824), g_static_metadata_bytes + 824),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 11,
&g_static_metadata_slice_refcounts[41].base, 11,
g_static_metadata_bytes + 828), g_static_metadata_bytes + 828),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 2,
&g_static_metadata_slice_refcounts[42].base, 2,
g_static_metadata_bytes + 839), g_static_metadata_bytes + 839),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 8,
&g_static_metadata_slice_refcounts[43].base, 8,
g_static_metadata_bytes + 841), g_static_metadata_bytes + 841),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 3,
&g_static_metadata_slice_refcounts[44].base, 3,
g_static_metadata_bytes + 849), g_static_metadata_bytes + 849),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 4,
&g_static_metadata_slice_refcounts[45].base, 4,
g_static_metadata_bytes + 852), g_static_metadata_bytes + 852),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 1,
&g_static_metadata_slice_refcounts[46].base, 1,
g_static_metadata_bytes + 856), g_static_metadata_bytes + 856),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 11,
&g_static_metadata_slice_refcounts[47].base, 11,
g_static_metadata_bytes + 857), g_static_metadata_bytes + 857),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 4,
&g_static_metadata_slice_refcounts[48].base, 4,
g_static_metadata_bytes + 868), g_static_metadata_bytes + 868),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 5,
&g_static_metadata_slice_refcounts[49].base, 5,
g_static_metadata_bytes + 872), g_static_metadata_bytes + 872),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 877), g_static_metadata_bytes + 877),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3,
&g_static_metadata_slice_refcounts[51].base, 3,
g_static_metadata_bytes + 880), g_static_metadata_bytes + 880),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 3,
&g_static_metadata_slice_refcounts[52].base, 3,
g_static_metadata_bytes + 883), g_static_metadata_bytes + 883),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 3,
&g_static_metadata_slice_refcounts[53].base, 3,
g_static_metadata_bytes + 886), g_static_metadata_bytes + 886),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 3,
&g_static_metadata_slice_refcounts[54].base, 3,
g_static_metadata_bytes + 889), g_static_metadata_bytes + 889),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 3,
&g_static_metadata_slice_refcounts[55].base, 3,
g_static_metadata_bytes + 892), g_static_metadata_bytes + 892),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 3,
&g_static_metadata_slice_refcounts[56].base, 3,
g_static_metadata_bytes + 895), g_static_metadata_bytes + 895),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 14,
&g_static_metadata_slice_refcounts[57].base, 14,
g_static_metadata_bytes + 898), g_static_metadata_bytes + 898),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
&g_static_metadata_slice_refcounts[58].base, 13,
g_static_metadata_bytes + 912), g_static_metadata_bytes + 912),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 15,
&g_static_metadata_slice_refcounts[59].base, 15,
g_static_metadata_bytes + 925), g_static_metadata_bytes + 925),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13,
&g_static_metadata_slice_refcounts[60].base, 13,
g_static_metadata_bytes + 940), g_static_metadata_bytes + 940),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 6,
&g_static_metadata_slice_refcounts[61].base, 6,
g_static_metadata_bytes + 953), g_static_metadata_bytes + 953),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 27,
&g_static_metadata_slice_refcounts[62].base, 27,
g_static_metadata_bytes + 959), g_static_metadata_bytes + 959),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 3,
&g_static_metadata_slice_refcounts[63].base, 3,
g_static_metadata_bytes + 986), g_static_metadata_bytes + 986),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 5,
&g_static_metadata_slice_refcounts[64].base, 5,
g_static_metadata_bytes + 989), g_static_metadata_bytes + 989),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 13,
&g_static_metadata_slice_refcounts[65].base, 13,
g_static_metadata_bytes + 994), g_static_metadata_bytes + 994),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13,
&g_static_metadata_slice_refcounts[66].base, 13,
g_static_metadata_bytes + 1007), g_static_metadata_bytes + 1007),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 19,
&g_static_metadata_slice_refcounts[67].base, 19,
g_static_metadata_bytes + 1020), g_static_metadata_bytes + 1020),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 16,
&g_static_metadata_slice_refcounts[68].base, 16,
g_static_metadata_bytes + 1039), g_static_metadata_bytes + 1039),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 14,
&g_static_metadata_slice_refcounts[69].base, 14,
g_static_metadata_bytes + 1055), g_static_metadata_bytes + 1055),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 16,
&g_static_metadata_slice_refcounts[70].base, 16,
g_static_metadata_bytes + 1069), g_static_metadata_bytes + 1069),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
&g_static_metadata_slice_refcounts[71].base, 13,
g_static_metadata_bytes + 1085), g_static_metadata_bytes + 1085),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 6,
&g_static_metadata_slice_refcounts[72].base, 6,
g_static_metadata_bytes + 1098), g_static_metadata_bytes + 1098),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 4,
&g_static_metadata_slice_refcounts[73].base, 4,
g_static_metadata_bytes + 1104), g_static_metadata_bytes + 1104),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 4,
&g_static_metadata_slice_refcounts[74].base, 4,
g_static_metadata_bytes + 1108), g_static_metadata_bytes + 1108),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 6,
&g_static_metadata_slice_refcounts[75].base, 6,
g_static_metadata_bytes + 1112), g_static_metadata_bytes + 1112),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 7,
&g_static_metadata_slice_refcounts[76].base, 7,
g_static_metadata_bytes + 1118), g_static_metadata_bytes + 1118),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 4,
&g_static_metadata_slice_refcounts[77].base, 4,
g_static_metadata_bytes + 1125), g_static_metadata_bytes + 1125),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 8,
&g_static_metadata_slice_refcounts[78].base, 8,
g_static_metadata_bytes + 1129), g_static_metadata_bytes + 1129),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 17,
&g_static_metadata_slice_refcounts[79].base, 17,
g_static_metadata_bytes + 1137), g_static_metadata_bytes + 1137),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 13,
&g_static_metadata_slice_refcounts[80].base, 13,
g_static_metadata_bytes + 1154), g_static_metadata_bytes + 1154),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 8,
&g_static_metadata_slice_refcounts[81].base, 8,
g_static_metadata_bytes + 1167), g_static_metadata_bytes + 1167),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 19,
&g_static_metadata_slice_refcounts[82].base, 19,
g_static_metadata_bytes + 1175), g_static_metadata_bytes + 1175),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 13,
&g_static_metadata_slice_refcounts[83].base, 13,
g_static_metadata_bytes + 1194), g_static_metadata_bytes + 1194),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 4,
&g_static_metadata_slice_refcounts[84].base, 4,
g_static_metadata_bytes + 1207), g_static_metadata_bytes + 1207),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 8,
&g_static_metadata_slice_refcounts[85].base, 8,
g_static_metadata_bytes + 1211), g_static_metadata_bytes + 1211),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 12,
&g_static_metadata_slice_refcounts[86].base, 12,
g_static_metadata_bytes + 1219), g_static_metadata_bytes + 1219),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 18,
&g_static_metadata_slice_refcounts[87].base, 18,
g_static_metadata_bytes + 1231), g_static_metadata_bytes + 1231),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 19,
&g_static_metadata_slice_refcounts[88].base, 19,
g_static_metadata_bytes + 1249), g_static_metadata_bytes + 1249),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 5,
&g_static_metadata_slice_refcounts[89].base, 5,
g_static_metadata_bytes + 1268), g_static_metadata_bytes + 1268),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 7,
&g_static_metadata_slice_refcounts[90].base, 7,
g_static_metadata_bytes + 1273), g_static_metadata_bytes + 1273),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 7,
&g_static_metadata_slice_refcounts[91].base, 7,
g_static_metadata_bytes + 1280), g_static_metadata_bytes + 1280),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 11,
&g_static_metadata_slice_refcounts[92].base, 11,
g_static_metadata_bytes + 1287), g_static_metadata_bytes + 1287),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 6,
&g_static_metadata_slice_refcounts[93].base, 6,
g_static_metadata_bytes + 1298), g_static_metadata_bytes + 1298),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 10,
&g_static_metadata_slice_refcounts[94].base, 10,
g_static_metadata_bytes + 1304), g_static_metadata_bytes + 1304),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 25,
&g_static_metadata_slice_refcounts[95].base, 25,
g_static_metadata_bytes + 1314), g_static_metadata_bytes + 1314),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 17,
&g_static_metadata_slice_refcounts[96].base, 17,
g_static_metadata_bytes + 1339), g_static_metadata_bytes + 1339),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 4,
&g_static_metadata_slice_refcounts[97].base, 4,
g_static_metadata_bytes + 1356), g_static_metadata_bytes + 1356),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 3,
&g_static_metadata_slice_refcounts[98].base, 3,
g_static_metadata_bytes + 1360), g_static_metadata_bytes + 1360),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 16,
&g_static_metadata_slice_refcounts[99].base, 16,
g_static_metadata_bytes + 1363), g_static_metadata_bytes + 1363),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 1,
&g_static_metadata_slice_refcounts[100].base, 1,
g_static_metadata_bytes + 1379), g_static_metadata_bytes + 1379),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8,
&g_static_metadata_slice_refcounts[101].base, 8,
g_static_metadata_bytes + 1380), g_static_metadata_bytes + 1380),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 16,
&g_static_metadata_slice_refcounts[102].base, 16,
g_static_metadata_bytes + 1388), g_static_metadata_bytes + 1388),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 4,
&g_static_metadata_slice_refcounts[103].base, 4,
g_static_metadata_bytes + 1404), g_static_metadata_bytes + 1404),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 3,
&g_static_metadata_slice_refcounts[104].base, 3,
g_static_metadata_bytes + 1408), g_static_metadata_bytes + 1408),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[105].base, 11,
&g_static_metadata_slice_refcounts[105].base, 11,
g_static_metadata_bytes + 1411), g_static_metadata_bytes + 1411),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[106].base, 16,
&g_static_metadata_slice_refcounts[106].base, 16,
g_static_metadata_bytes + 1422), g_static_metadata_bytes + 1422),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13,
&g_static_metadata_slice_refcounts[107].base, 13,
g_static_metadata_bytes + 1438), g_static_metadata_bytes + 1438),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[108].base, 12,
&g_static_metadata_slice_refcounts[108].base, 12,
g_static_metadata_bytes + 1451), g_static_metadata_bytes + 1451),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[109].base, 21,
&g_static_metadata_slice_refcounts[109].base, 21,
g_static_metadata_bytes + 1463), g_static_metadata_bytes + 1463),
}; };
} // namespace grpc_core } // namespace grpc_core

@ -42,7 +42,7 @@ void RegisterBuiltins(CoreConfiguration::Builder* builder) {
builder->channel_init()->RegisterStage( builder->channel_init()->RegisterStage(
GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) { GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) {
return grpc_channel_stack_builder_prepend_filter( return grpc_channel_stack_builder_prepend_filter(
builder, &grpc_core::Server::kServerTopFilter, nullptr, nullptr); builder, &Server::kServerTopFilter, nullptr, nullptr);
}); });
} }

@ -85,7 +85,7 @@ struct RegisteredCall {
}; };
struct CallRegistrationTable { struct CallRegistrationTable {
grpc_core::Mutex mu; Mutex mu;
// The map key should be owned strings rather than unowned char*'s to // The map key should be owned strings rather than unowned char*'s to
// guarantee that it outlives calls on the core channel (which may outlast the // guarantee that it outlives calls on the core channel (which may outlast the
// C++ or other wrapped language Channel that registered these calls). // C++ or other wrapped language Channel that registered these calls).

@ -141,7 +141,7 @@ void ErrorDestroy(void* p) {
delete error; delete error;
} }
} }
int ErrorCompare(void* p, void* q) { return grpc_core::QsortCompare(p, q); } int ErrorCompare(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kLameFilterErrorArgVtable = { const grpc_arg_pointer_vtable kLameFilterErrorArgVtable = {
ErrorCopy, ErrorDestroy, ErrorCompare}; ErrorCopy, ErrorDestroy, ErrorCompare};

@ -601,7 +601,7 @@ void Server::Start() {
grpc_error_handle Server::SetupTransport( grpc_error_handle Server::SetupTransport(
grpc_transport* transport, grpc_pollset* accepting_pollset, grpc_transport* transport, grpc_pollset* accepting_pollset,
const grpc_channel_args* args, const grpc_channel_args* args,
const RefCountedPtr<grpc_core::channelz::SocketNode>& socket_node) { const RefCountedPtr<channelz::SocketNode>& socket_node) {
// Create channel. // Create channel.
grpc_error_handle error = GRPC_ERROR_NONE; grpc_error_handle error = GRPC_ERROR_NONE;
grpc_channel* channel = grpc_channel_create( grpc_channel* channel = grpc_channel_create(

@ -81,7 +81,7 @@ grpc_millis BdpEstimator::CompletePing() {
} }
ping_state_ = PingState::UNSCHEDULED; ping_state_ = PingState::UNSCHEDULED;
accumulator_ = 0; accumulator_ = 0;
return grpc_core::ExecCtx::Get()->Now() + inter_ping_delay_; return ExecCtx::Get()->Now() + inter_ping_delay_;
} }
} // namespace grpc_core } // namespace grpc_core

@ -313,10 +313,10 @@ class AllocatedMetadata : public RefcountedMdBase {
// TODO(arjunroy): Change to use strongly typed slices instead. // TODO(arjunroy): Change to use strongly typed slices instead.
struct NoRefKey {}; struct NoRefKey {};
AllocatedMetadata(const grpc_slice& key, const grpc_slice& value); AllocatedMetadata(const grpc_slice& key, const grpc_slice& value);
AllocatedMetadata(const grpc_core::ManagedMemorySlice& key, AllocatedMetadata(const ManagedMemorySlice& key,
const grpc_core::UnmanagedMemorySlice& value); const UnmanagedMemorySlice& value);
AllocatedMetadata(const grpc_core::ExternallyManagedSlice& key, AllocatedMetadata(const ExternallyManagedSlice& key,
const grpc_core::UnmanagedMemorySlice& value); const UnmanagedMemorySlice& value);
AllocatedMetadata(const grpc_slice& key, const grpc_slice& value, AllocatedMetadata(const grpc_slice& key, const grpc_slice& value,
const NoRefKey*); const NoRefKey*);
~AllocatedMetadata(); ~AllocatedMetadata();

@ -95,7 +95,7 @@ struct GrpcTimeoutMetadata {
if (timeout == GRPC_MILLIS_INF_FUTURE) { if (timeout == GRPC_MILLIS_INF_FUTURE) {
return GRPC_MILLIS_INF_FUTURE; return GRPC_MILLIS_INF_FUTURE;
} }
return grpc_core::ExecCtx::Get()->Now() + timeout; return ExecCtx::Get()->Now() + timeout;
} }
static grpc_slice Encode(ValueType x) { static grpc_slice Encode(ValueType x) {
char timeout[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; char timeout[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
@ -820,9 +820,8 @@ absl::optional<absl::string_view> MetadataMap<Traits...>::GetValue(
// Find all values for the specified key. // Find all values for the specified key.
absl::InlinedVector<absl::string_view, 1> values; absl::InlinedVector<absl::string_view, 1> values;
for (grpc_linked_mdelem* md = list_.head; md != nullptr; md = md->next) { for (grpc_linked_mdelem* md = list_.head; md != nullptr; md = md->next) {
absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md->md)); absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
absl::string_view value = absl::string_view value = StringViewFromSlice(GRPC_MDVALUE(md->md));
grpc_core::StringViewFromSlice(GRPC_MDVALUE(md->md));
if (target_key == key) values.push_back(value); if (target_key == key) values.push_back(value);
} }
// If none found, no match. // If none found, no match.

@ -31,8 +31,8 @@ double PidController::Update(double error, double dt) {
if (dt <= 0) return last_control_value_; if (dt <= 0) return last_control_value_;
/* integrate error using the trapezoid rule */ /* integrate error using the trapezoid rule */
error_integral_ += dt * (last_error_ + error) * 0.5; error_integral_ += dt * (last_error_ + error) * 0.5;
error_integral_ = grpc_core::Clamp(error_integral_, -args_.integral_range(), error_integral_ =
args_.integral_range()); Clamp(error_integral_, -args_.integral_range(), args_.integral_range());
double diff_error = (error - last_error_) / dt; double diff_error = (error - last_error_) / dt;
/* calculate derivative of control value vs time */ /* calculate derivative of control value vs time */
double dc_dt = args_.gain_p() * error + args_.gain_i() * error_integral_ + double dc_dt = args_.gain_p() * error + args_.gain_i() * error_integral_ +
@ -40,8 +40,8 @@ double PidController::Update(double error, double dt) {
/* and perform trapezoidal integration */ /* and perform trapezoidal integration */
double new_control_value = double new_control_value =
last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5; last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5;
new_control_value = grpc_core::Clamp( new_control_value = Clamp(new_control_value, args_.min_control_value(),
new_control_value, args_.min_control_value(), args_.max_control_value()); args_.max_control_value());
last_error_ = error; last_error_ = error;
last_dc_dt_ = dc_dt; last_dc_dt_ = dc_dt;
last_control_value_ = new_control_value; last_control_value_ = new_control_value;

@ -32,592 +32,508 @@
namespace grpc_core { namespace grpc_core {
StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[3].base, 10, StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10,
g_static_metadata_bytes + 19), g_static_metadata_bytes + 19),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
0), 0),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[1].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5), g_static_metadata_bytes + 5),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 3,
&g_static_metadata_slice_refcounts[44].base, 3,
g_static_metadata_bytes + 849), g_static_metadata_bytes + 849),
1), 1),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[1].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5), g_static_metadata_bytes + 5),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 4,
&g_static_metadata_slice_refcounts[45].base, 4,
g_static_metadata_bytes + 852), g_static_metadata_bytes + 852),
2), 2),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[0].base, 5, StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
g_static_metadata_bytes + 0), g_static_metadata_bytes + 0),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 1,
&g_static_metadata_slice_refcounts[46].base, 1,
g_static_metadata_bytes + 856), g_static_metadata_bytes + 856),
3), 3),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[0].base, 5, StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
g_static_metadata_bytes + 0), g_static_metadata_bytes + 0),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 11,
&g_static_metadata_slice_refcounts[47].base, 11,
g_static_metadata_bytes + 857), g_static_metadata_bytes + 857),
4), 4),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[4].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29), g_static_metadata_bytes + 29),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 4,
&g_static_metadata_slice_refcounts[48].base, 4,
g_static_metadata_bytes + 868), g_static_metadata_bytes + 868),
5), 5),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[4].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29), g_static_metadata_bytes + 29),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 5,
&g_static_metadata_slice_refcounts[49].base, 5,
g_static_metadata_bytes + 872), g_static_metadata_bytes + 872),
6), 6),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 877), g_static_metadata_bytes + 877),
7), 7),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3,
&g_static_metadata_slice_refcounts[51].base, 3,
g_static_metadata_bytes + 880), g_static_metadata_bytes + 880),
8), 8),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 3,
&g_static_metadata_slice_refcounts[52].base, 3,
g_static_metadata_bytes + 883), g_static_metadata_bytes + 883),
9), 9),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 3,
&g_static_metadata_slice_refcounts[53].base, 3,
g_static_metadata_bytes + 886), g_static_metadata_bytes + 886),
10), 10),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 3,
&g_static_metadata_slice_refcounts[54].base, 3,
g_static_metadata_bytes + 889), g_static_metadata_bytes + 889),
11), 11),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 3,
&g_static_metadata_slice_refcounts[55].base, 3,
g_static_metadata_bytes + 892), g_static_metadata_bytes + 892),
12), 12),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[2].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12), g_static_metadata_bytes + 12),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 3,
&g_static_metadata_slice_refcounts[56].base, 3,
g_static_metadata_bytes + 895), g_static_metadata_bytes + 895),
13), 13),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[57].base, 14, StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 14,
g_static_metadata_bytes + 898), g_static_metadata_bytes + 898),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
14), 14),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[15].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
&g_static_metadata_slice_refcounts[58].base, 13,
g_static_metadata_bytes + 912), g_static_metadata_bytes + 912),
15), 15),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[59].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 15,
g_static_metadata_bytes + 925), g_static_metadata_bytes + 925),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
16), 16),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[60].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13,
g_static_metadata_bytes + 940), g_static_metadata_bytes + 940),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
17), 17),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[61].base, 6, StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 6,
g_static_metadata_bytes + 953), g_static_metadata_bytes + 953),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
18), 18),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[62].base, 27, StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 27,
g_static_metadata_bytes + 959), g_static_metadata_bytes + 959),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
19), 19),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[63].base, 3, StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 3,
g_static_metadata_bytes + 986), g_static_metadata_bytes + 986),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
20), 20),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[64].base, 5, StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 5,
g_static_metadata_bytes + 989), g_static_metadata_bytes + 989),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
21), 21),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[65].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 13,
g_static_metadata_bytes + 994), g_static_metadata_bytes + 994),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
22), 22),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[66].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13,
g_static_metadata_bytes + 1007), g_static_metadata_bytes + 1007),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
23), 23),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[67].base, 19, StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 19,
g_static_metadata_bytes + 1020), g_static_metadata_bytes + 1020),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
24), 24),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[14].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168), g_static_metadata_bytes + 168),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
25), 25),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[68].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 16,
g_static_metadata_bytes + 1039), g_static_metadata_bytes + 1039),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
26), 26),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[69].base, 14, StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 14,
g_static_metadata_bytes + 1055), g_static_metadata_bytes + 1055),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
27), 27),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[70].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 16,
g_static_metadata_bytes + 1069), g_static_metadata_bytes + 1069),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
28), 28),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[71].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
g_static_metadata_bytes + 1085), g_static_metadata_bytes + 1085),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
29), 29),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[13].base, 12, StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156), g_static_metadata_bytes + 156),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
30), 30),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[72].base, 6, StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 6,
g_static_metadata_bytes + 1098), g_static_metadata_bytes + 1098),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
31), 31),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[73].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 4,
g_static_metadata_bytes + 1104), g_static_metadata_bytes + 1104),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
32), 32),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[74].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 4,
g_static_metadata_bytes + 1108), g_static_metadata_bytes + 1108),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
33), 33),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[75].base, 6, StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 6,
g_static_metadata_bytes + 1112), g_static_metadata_bytes + 1112),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
34), 34),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[76].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 7,
g_static_metadata_bytes + 1118), g_static_metadata_bytes + 1118),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
35), 35),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[77].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 4,
g_static_metadata_bytes + 1125), g_static_metadata_bytes + 1125),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
36), 36),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[19].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 4,
g_static_metadata_bytes + 276), g_static_metadata_bytes + 276),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
37), 37),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[78].base, 8, StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 8,
g_static_metadata_bytes + 1129), g_static_metadata_bytes + 1129),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
38), 38),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[79].base, 17, StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 17,
g_static_metadata_bytes + 1137), g_static_metadata_bytes + 1137),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
39), 39),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[80].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 13,
g_static_metadata_bytes + 1154), g_static_metadata_bytes + 1154),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
40), 40),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[81].base, 8, StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 8,
g_static_metadata_bytes + 1167), g_static_metadata_bytes + 1167),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
41), 41),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[82].base, 19, StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 19,
g_static_metadata_bytes + 1175), g_static_metadata_bytes + 1175),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
42), 42),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[83].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 13,
g_static_metadata_bytes + 1194), g_static_metadata_bytes + 1194),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
43), 43),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[84].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 4,
g_static_metadata_bytes + 1207), g_static_metadata_bytes + 1207),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
44), 44),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[85].base, 8, StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 8,
g_static_metadata_bytes + 1211), g_static_metadata_bytes + 1211),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
45), 45),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[86].base, 12, StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 12,
g_static_metadata_bytes + 1219), g_static_metadata_bytes + 1219),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
46), 46),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[87].base, 18, StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 18,
g_static_metadata_bytes + 1231), g_static_metadata_bytes + 1231),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
47), 47),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[88].base, 19, StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 19,
g_static_metadata_bytes + 1249), g_static_metadata_bytes + 1249),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
48), 48),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[89].base, 5, StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 5,
g_static_metadata_bytes + 1268), g_static_metadata_bytes + 1268),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
49), 49),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[90].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 7,
g_static_metadata_bytes + 1273), g_static_metadata_bytes + 1273),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
50), 50),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[91].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 7,
g_static_metadata_bytes + 1280), g_static_metadata_bytes + 1280),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
51), 51),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[92].base, 11, StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 11,
g_static_metadata_bytes + 1287), g_static_metadata_bytes + 1287),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
52), 52),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[93].base, 6, StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 6,
g_static_metadata_bytes + 1298), g_static_metadata_bytes + 1298),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
53), 53),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[94].base, 10, StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 10,
g_static_metadata_bytes + 1304), g_static_metadata_bytes + 1304),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
54), 54),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[95].base, 25, StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 25,
g_static_metadata_bytes + 1314), g_static_metadata_bytes + 1314),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
55), 55),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[96].base, 17, StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 17,
g_static_metadata_bytes + 1339), g_static_metadata_bytes + 1339),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
56), 56),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[18].base, 10, StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 10,
g_static_metadata_bytes + 266), g_static_metadata_bytes + 266),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
57), 57),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[97].base, 4, StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 4,
g_static_metadata_bytes + 1356), g_static_metadata_bytes + 1356),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
58), 58),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[98].base, 3, StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 3,
g_static_metadata_bytes + 1360), g_static_metadata_bytes + 1360),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
59), 59),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[99].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 16,
g_static_metadata_bytes + 1363), g_static_metadata_bytes + 1363),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
60), 60),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[6].base, 11, StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48), g_static_metadata_bytes + 48),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 1,
&g_static_metadata_slice_refcounts[100].base, 1,
g_static_metadata_bytes + 1379), g_static_metadata_bytes + 1379),
61), 61),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[6].base, 11, StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48), g_static_metadata_bytes + 48),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1,
&g_static_metadata_slice_refcounts[24].base, 1,
g_static_metadata_bytes + 367), g_static_metadata_bytes + 367),
62), 62),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[6].base, 11, StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48), g_static_metadata_bytes + 48),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 1,
&g_static_metadata_slice_refcounts[25].base, 1,
g_static_metadata_bytes + 368), g_static_metadata_bytes + 368),
63), 63),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[8].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75), g_static_metadata_bytes + 75),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8,
&g_static_metadata_slice_refcounts[101].base, 8,
g_static_metadata_bytes + 1380), g_static_metadata_bytes + 1380),
64), 64),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[8].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75), g_static_metadata_bytes + 75),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 824), g_static_metadata_bytes + 824),
65), 65),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[8].base, 13, StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75), g_static_metadata_bytes + 75),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7,
&g_static_metadata_slice_refcounts[39].base, 7,
g_static_metadata_bytes + 817), g_static_metadata_bytes + 817),
66), 66),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[13].base, 12, StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156), g_static_metadata_bytes + 156),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 16,
&g_static_metadata_slice_refcounts[102].base, 16,
g_static_metadata_bytes + 1388), g_static_metadata_bytes + 1388),
67), 67),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[4].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29), g_static_metadata_bytes + 29),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 4,
&g_static_metadata_slice_refcounts[103].base, 4,
g_static_metadata_bytes + 1404), g_static_metadata_bytes + 1404),
68), 68),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[1].base, 7, StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5), g_static_metadata_bytes + 5),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 3,
&g_static_metadata_slice_refcounts[104].base, 3,
g_static_metadata_bytes + 1408), g_static_metadata_bytes + 1408),
69), 69),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[15].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
70), 70),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[14].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168), g_static_metadata_bytes + 168),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8,
&g_static_metadata_slice_refcounts[101].base, 8,
g_static_metadata_bytes + 1380), g_static_metadata_bytes + 1380),
71), 71),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[14].base, 16, StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168), g_static_metadata_bytes + 168),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 824), g_static_metadata_bytes + 824),
72), 72),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[105].base, 11, StaticMetadataSlice(&g_static_metadata_slice_refcounts[105].base, 11,
g_static_metadata_bytes + 1411), g_static_metadata_bytes + 1411),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0,
&g_static_metadata_slice_refcounts[28].base, 0,
g_static_metadata_bytes + 371), g_static_metadata_bytes + 371),
73), 73),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8,
&g_static_metadata_slice_refcounts[101].base, 8,
g_static_metadata_bytes + 1380), g_static_metadata_bytes + 1380),
74), 74),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7,
&g_static_metadata_slice_refcounts[39].base, 7,
g_static_metadata_bytes + 817), g_static_metadata_bytes + 817),
75), 75),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[106].base, 16,
&g_static_metadata_slice_refcounts[106].base, 16,
g_static_metadata_bytes + 1422), g_static_metadata_bytes + 1422),
76), 76),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 824), g_static_metadata_bytes + 824),
77), 77),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13,
&g_static_metadata_slice_refcounts[107].base, 13,
g_static_metadata_bytes + 1438), g_static_metadata_bytes + 1438),
78), 78),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[108].base, 12,
&g_static_metadata_slice_refcounts[108].base, 12,
g_static_metadata_bytes + 1451), g_static_metadata_bytes + 1451),
79), 79),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[9].base, 20, StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88), g_static_metadata_bytes + 88),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[109].base, 21,
&g_static_metadata_slice_refcounts[109].base, 21,
g_static_metadata_bytes + 1463), g_static_metadata_bytes + 1463),
80), 80),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[15].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8,
&g_static_metadata_slice_refcounts[101].base, 8,
g_static_metadata_bytes + 1380), g_static_metadata_bytes + 1380),
81), 81),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[15].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 824), g_static_metadata_bytes + 824),
82), 82),
StaticMetadata(grpc_core::StaticMetadataSlice( StaticMetadata(
&g_static_metadata_slice_refcounts[15].base, 15, StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184), g_static_metadata_bytes + 184),
grpc_core::StaticMetadataSlice( StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13,
&g_static_metadata_slice_refcounts[107].base, 13,
g_static_metadata_bytes + 1438), g_static_metadata_bytes + 1438),
83), 83),
}; };

@ -849,7 +849,7 @@ void alts_handshaker_client_on_status_received_for_testing(
reinterpret_cast<alts_grpc_handshaker_client*>(c); reinterpret_cast<alts_grpc_handshaker_client*>(c);
client->handshake_status_code = status; client->handshake_status_code = status;
client->handshake_status_details = grpc_empty_slice(); client->handshake_status_details = grpc_empty_slice();
grpc_core::Closure::Run(DEBUG_LOCATION, &client->on_status_received, error); Closure::Run(DEBUG_LOCATION, &client->on_status_received, error);
} }
} // namespace internal } // namespace internal

@ -123,7 +123,7 @@ const int kEventListMemoryLimit = 1024 * 1024;
// Tests basic ChannelTrace functionality like construction, adding trace, and // Tests basic ChannelTrace functionality like construction, adding trace, and
// lookups by uuid. // lookups by uuid.
TEST(ChannelTracerTest, BasicTest) { TEST(ChannelTracerTest, BasicTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelTrace tracer(kEventListMemoryLimit); ChannelTrace tracer(kEventListMemoryLimit);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
@ -146,7 +146,7 @@ TEST(ChannelTracerTest, BasicTest) {
// subchannles. This exercises the ref/unref patterns since the parent tracer // subchannles. This exercises the ref/unref patterns since the parent tracer
// and this function will both hold refs to the subchannel. // and this function will both hold refs to the subchannel.
TEST(ChannelTracerTest, ComplexTest) { TEST(ChannelTracerTest, ComplexTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelTrace tracer(kEventListMemoryLimit); ChannelTrace tracer(kEventListMemoryLimit);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
@ -193,7 +193,7 @@ TEST(ChannelTracerTest, ComplexTest) {
// have connections. Ensures that everything lives as long as it should then // have connections. Ensures that everything lives as long as it should then
// gets deleted. // gets deleted.
TEST(ChannelTracerTest, TestNesting) { TEST(ChannelTracerTest, TestNesting) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelTrace tracer(kEventListMemoryLimit); ChannelTrace tracer(kEventListMemoryLimit);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
AddSimpleTrace(&tracer); AddSimpleTrace(&tracer);
@ -240,7 +240,7 @@ TEST(ChannelTracerTest, TestNesting) {
} }
TEST(ChannelTracerTest, TestSmallMemoryLimit) { TEST(ChannelTracerTest, TestSmallMemoryLimit) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// doesn't make sense, but serves a testing purpose for the channel tracing // doesn't make sense, but serves a testing purpose for the channel tracing
// bookkeeping. All tracing events added should will get immediately garbage // bookkeeping. All tracing events added should will get immediately garbage
// collected. // collected.
@ -264,7 +264,7 @@ TEST(ChannelTracerTest, TestSmallMemoryLimit) {
} }
TEST(ChannelTracerTest, TestEviction) { TEST(ChannelTracerTest, TestEviction) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
const int kTraceEventSize = GetSizeofTraceEvent(); const int kTraceEventSize = GetSizeofTraceEvent();
const int kNumEvents = 5; const int kNumEvents = 5;
ChannelTrace tracer(kTraceEventSize * kNumEvents); ChannelTrace tracer(kTraceEventSize * kNumEvents);
@ -281,7 +281,7 @@ TEST(ChannelTracerTest, TestEviction) {
} }
TEST(ChannelTracerTest, TestMultipleEviction) { TEST(ChannelTracerTest, TestMultipleEviction) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
const int kTraceEventSize = GetSizeofTraceEvent(); const int kTraceEventSize = GetSizeofTraceEvent();
const int kNumEvents = 5; const int kNumEvents = 5;
ChannelTrace tracer(kTraceEventSize * kNumEvents); ChannelTrace tracer(kTraceEventSize * kNumEvents);
@ -300,7 +300,7 @@ TEST(ChannelTracerTest, TestMultipleEviction) {
} }
TEST(ChannelTracerTest, TestTotalEviction) { TEST(ChannelTracerTest, TestTotalEviction) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
const int kTraceEventSize = GetSizeofTraceEvent(); const int kTraceEventSize = GetSizeofTraceEvent();
const int kNumEvents = 5; const int kNumEvents = 5;
ChannelTrace tracer(kTraceEventSize * kNumEvents); ChannelTrace tracer(kTraceEventSize * kNumEvents);

@ -248,7 +248,7 @@ gpr_timespec GetLastCallStartedTime(CallCountingHelper* channel) {
void ChannelzSleep(int64_t sleep_us) { void ChannelzSleep(int64_t sleep_us) {
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_micros(sleep_us, GPR_TIMESPAN))); gpr_time_from_micros(sleep_us, GPR_TIMESPAN)));
grpc_core::ExecCtx::Get()->InvalidateNow(); ExecCtx::Get()->InvalidateNow();
} }
} // anonymous namespace } // anonymous namespace
@ -256,7 +256,7 @@ void ChannelzSleep(int64_t sleep_us) {
class ChannelzChannelTest : public ::testing::TestWithParam<size_t> {}; class ChannelzChannelTest : public ::testing::TestWithParam<size_t> {};
TEST_P(ChannelzChannelTest, BasicChannel) { TEST_P(ChannelzChannelTest, BasicChannel) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channel(GetParam()); ChannelFixture channel(GetParam());
ChannelNode* channelz_channel = ChannelNode* channelz_channel =
grpc_channel_get_channelz_node(channel.channel()); grpc_channel_get_channelz_node(channel.channel());
@ -264,7 +264,7 @@ TEST_P(ChannelzChannelTest, BasicChannel) {
} }
TEST(ChannelzChannelTest, ChannelzDisabled) { TEST(ChannelzChannelTest, ChannelzDisabled) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// explicitly disable channelz // explicitly disable channelz
grpc_arg arg[] = { grpc_arg arg[] = {
grpc_channel_arg_integer_create( grpc_channel_arg_integer_create(
@ -281,7 +281,7 @@ TEST(ChannelzChannelTest, ChannelzDisabled) {
} }
TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) { TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channel(GetParam()); ChannelFixture channel(GetParam());
ChannelNode* channelz_channel = ChannelNode* channelz_channel =
grpc_channel_get_channelz_node(channel.channel()); grpc_channel_get_channelz_node(channel.channel());
@ -299,7 +299,7 @@ TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) {
} }
TEST_P(ChannelzChannelTest, LastCallStartedTime) { TEST_P(ChannelzChannelTest, LastCallStartedTime) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
CallCountingHelper counter; CallCountingHelper counter;
// start a call to set the last call started timestamp // start a call to set the last call started timestamp
counter.RecordCallStarted(); counter.RecordCallStarted();
@ -337,25 +337,25 @@ class ChannelzRegistryBasedTest : public ::testing::TestWithParam<size_t> {
}; };
TEST_F(ChannelzRegistryBasedTest, BasicGetTopChannelsTest) { TEST_F(ChannelzRegistryBasedTest, BasicGetTopChannelsTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channel; ChannelFixture channel;
ValidateGetTopChannels(1); ValidateGetTopChannels(1);
} }
TEST_F(ChannelzRegistryBasedTest, NoChannelsTest) { TEST_F(ChannelzRegistryBasedTest, NoChannelsTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ValidateGetTopChannels(0); ValidateGetTopChannels(0);
} }
TEST_F(ChannelzRegistryBasedTest, ManyChannelsTest) { TEST_F(ChannelzRegistryBasedTest, ManyChannelsTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channels[10]; ChannelFixture channels[10];
(void)channels; // suppress unused variable error (void)channels; // suppress unused variable error
ValidateGetTopChannels(10); ValidateGetTopChannels(10);
} }
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsPagination) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsPagination) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// This is over the pagination limit. // This is over the pagination limit.
ChannelFixture channels[150]; ChannelFixture channels[150];
(void)channels; // suppress unused variable error (void)channels; // suppress unused variable error
@ -383,7 +383,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsPagination) {
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidCheck) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidCheck) {
const intptr_t kNumChannels = 50; const intptr_t kNumChannels = 50;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channels[kNumChannels]; ChannelFixture channels[kNumChannels];
(void)channels; // suppress unused variable error (void)channels; // suppress unused variable error
std::string json_str = ChannelzRegistry::GetTopChannels(0); std::string json_str = ChannelzRegistry::GetTopChannels(0);
@ -402,7 +402,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidCheck) {
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMiddleUuidCheck) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMiddleUuidCheck) {
const intptr_t kNumChannels = 50; const intptr_t kNumChannels = 50;
const intptr_t kMidQuery = 40; const intptr_t kMidQuery = 40;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channels[kNumChannels]; ChannelFixture channels[kNumChannels];
(void)channels; // suppress unused variable error (void)channels; // suppress unused variable error
// Only query for the end of the channels. // Only query for the end of the channels.
@ -420,7 +420,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMiddleUuidCheck) {
} }
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture pre_channels[40]; // will take uuid[1, 40] ChannelFixture pre_channels[40]; // will take uuid[1, 40]
(void)pre_channels; // suppress unused variable error (void)pre_channels; // suppress unused variable error
ServerFixture servers[10]; // will take uuid[41, 50] ServerFixture servers[10]; // will take uuid[41, 50]
@ -442,7 +442,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) {
} }
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channel_with_uuid1; ChannelFixture channel_with_uuid1;
{ ServerFixture channel_with_uuid2; } { ServerFixture channel_with_uuid2; }
ChannelFixture channel_with_uuid3; ChannelFixture channel_with_uuid3;
@ -472,7 +472,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) {
TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) {
const intptr_t kLoopIterations = 50; const intptr_t kLoopIterations = 50;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
std::vector<std::unique_ptr<ChannelFixture>> even_channels; std::vector<std::unique_ptr<ChannelFixture>> even_channels;
{ {
// these will delete and unregister themselves after this block. // these will delete and unregister themselves after this block.
@ -497,7 +497,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) {
} }
TEST_F(ChannelzRegistryBasedTest, InternalChannelTest) { TEST_F(ChannelzRegistryBasedTest, InternalChannelTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ChannelFixture channels[10]; ChannelFixture channels[10];
(void)channels; // suppress unused variable error (void)channels; // suppress unused variable error
// create an internal channel // create an internal channel
@ -516,7 +516,7 @@ TEST_F(ChannelzRegistryBasedTest, InternalChannelTest) {
} }
TEST(ChannelzServerTest, BasicServerAPIFunctionality) { TEST(ChannelzServerTest, BasicServerAPIFunctionality) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ServerFixture server(10); ServerFixture server(10);
ServerNode* channelz_server = server.server()->core_server->channelz_node(); ServerNode* channelz_server = server.server()->core_server->channelz_node();
channelz_server->RecordCallStarted(); channelz_server->RecordCallStarted();
@ -533,18 +533,18 @@ TEST(ChannelzServerTest, BasicServerAPIFunctionality) {
} }
TEST_F(ChannelzRegistryBasedTest, BasicGetServersTest) { TEST_F(ChannelzRegistryBasedTest, BasicGetServersTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ServerFixture server; ServerFixture server;
ValidateGetServers(1); ValidateGetServers(1);
} }
TEST_F(ChannelzRegistryBasedTest, NoServersTest) { TEST_F(ChannelzRegistryBasedTest, NoServersTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ValidateGetServers(0); ValidateGetServers(0);
} }
TEST_F(ChannelzRegistryBasedTest, ManyServersTest) { TEST_F(ChannelzRegistryBasedTest, ManyServersTest) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
ServerFixture servers[10]; ServerFixture servers[10];
(void)servers; // suppress unused variable error (void)servers; // suppress unused variable error
ValidateGetServers(10); ValidateGetServers(10);

@ -491,7 +491,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigPickFirst) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
auto lb_config = parsed_config->parsed_lb_config(); auto lb_config = parsed_config->parsed_lb_config();
EXPECT_STREQ(lb_config->name(), "pick_first"); EXPECT_STREQ(lb_config->name(), "pick_first");
@ -503,8 +503,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigRoundRobin) {
grpc_error_handle error = GRPC_ERROR_NONE; grpc_error_handle error = GRPC_ERROR_NONE;
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
auto parsed_config = auto parsed_config = static_cast<internal::ClientChannelGlobalParsedConfig*>(
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
auto lb_config = parsed_config->parsed_lb_config(); auto lb_config = parsed_config->parsed_lb_config();
EXPECT_STREQ(lb_config->name(), "round_robin"); EXPECT_STREQ(lb_config->name(), "round_robin");
@ -518,7 +517,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigGrpclb) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
auto lb_config = parsed_config->parsed_lb_config(); auto lb_config = parsed_config->parsed_lb_config();
EXPECT_STREQ(lb_config->name(), "grpclb"); EXPECT_STREQ(lb_config->name(), "grpclb");
@ -541,7 +540,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigXds) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
auto lb_config = parsed_config->parsed_lb_config(); auto lb_config = parsed_config->parsed_lb_config();
EXPECT_STREQ(lb_config->name(), "xds_cluster_resolver_experimental"); EXPECT_STREQ(lb_config->name(), "xds_cluster_resolver_experimental");
@ -586,7 +585,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingPolicy) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
EXPECT_EQ(parsed_config->parsed_deprecated_lb_policy(), "pick_first"); EXPECT_EQ(parsed_config->parsed_deprecated_lb_policy(), "pick_first");
} }
@ -597,7 +596,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingPolicyAllCaps) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
EXPECT_EQ(parsed_config->parsed_deprecated_lb_policy(), "pick_first"); EXPECT_EQ(parsed_config->parsed_deprecated_lb_policy(), "pick_first");
} }
@ -648,8 +647,8 @@ TEST_F(ClientChannelParserTest, ValidTimeout) {
grpc_slice_from_static_string("/TestServ/TestMethod")); grpc_slice_from_static_string("/TestServ/TestMethod"));
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
auto parsed_config = ((*vector_ptr)[0]).get(); auto parsed_config = ((*vector_ptr)[0]).get();
EXPECT_EQ((static_cast<grpc_core::internal::ClientChannelMethodParsedConfig*>( EXPECT_EQ(
parsed_config)) (static_cast<internal::ClientChannelMethodParsedConfig*>(parsed_config))
->timeout(), ->timeout(),
5000); 5000);
} }
@ -694,13 +693,11 @@ TEST_F(ClientChannelParserTest, ValidWaitForReady) {
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
auto parsed_config = ((*vector_ptr)[0]).get(); auto parsed_config = ((*vector_ptr)[0]).get();
ASSERT_TRUE( ASSERT_TRUE(
(static_cast<grpc_core::internal::ClientChannelMethodParsedConfig*>( (static_cast<internal::ClientChannelMethodParsedConfig*>(parsed_config))
parsed_config))
->wait_for_ready() ->wait_for_ready()
.has_value()); .has_value());
EXPECT_TRUE( EXPECT_TRUE(
(static_cast<grpc_core::internal::ClientChannelMethodParsedConfig*>( (static_cast<internal::ClientChannelMethodParsedConfig*>(parsed_config))
parsed_config))
->wait_for_ready() ->wait_for_ready()
.value()); .value());
} }
@ -737,7 +734,7 @@ TEST_F(ClientChannelParserTest, ValidHealthCheck) {
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::ClientChannelGlobalParsedConfig*>( static_cast<internal::ClientChannelGlobalParsedConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->health_check_service_name(), EXPECT_EQ(parsed_config->health_check_service_name(),
@ -789,8 +786,7 @@ TEST_F(RetryParserTest, ValidRetryThrottling) {
grpc_error_handle error = GRPC_ERROR_NONE; grpc_error_handle error = GRPC_ERROR_NONE;
auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error);
ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
const auto* parsed_config = const auto* parsed_config = static_cast<internal::RetryGlobalConfig*>(
static_cast<grpc_core::internal::RetryGlobalConfig*>(
svc_cfg->GetGlobalParsedConfig(0)); svc_cfg->GetGlobalParsedConfig(0));
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->max_milli_tokens(), 2000); EXPECT_EQ(parsed_config->max_milli_tokens(), 2000);
@ -878,8 +874,7 @@ TEST_F(RetryParserTest, ValidRetryPolicy) {
grpc_slice_from_static_string("/TestServ/TestMethod")); grpc_slice_from_static_string("/TestServ/TestMethod"));
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::RetryMethodConfig*>( static_cast<internal::RetryMethodConfig*>(((*vector_ptr)[0]).get());
((*vector_ptr)[0]).get());
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->max_attempts(), 3); EXPECT_EQ(parsed_config->max_attempts(), 3);
EXPECT_EQ(parsed_config->initial_backoff(), 1000); EXPECT_EQ(parsed_config->initial_backoff(), 1000);
@ -1264,8 +1259,7 @@ TEST_F(RetryParserTest, ValidRetryPolicyWithPerAttemptRecvTimeout) {
grpc_slice_from_static_string("/TestServ/TestMethod")); grpc_slice_from_static_string("/TestServ/TestMethod"));
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::RetryMethodConfig*>( static_cast<internal::RetryMethodConfig*>(((*vector_ptr)[0]).get());
((*vector_ptr)[0]).get());
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->max_attempts(), 2);
EXPECT_EQ(parsed_config->initial_backoff(), 1000); EXPECT_EQ(parsed_config->initial_backoff(), 1000);
@ -1301,8 +1295,7 @@ TEST_F(RetryParserTest,
grpc_slice_from_static_string("/TestServ/TestMethod")); grpc_slice_from_static_string("/TestServ/TestMethod"));
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::RetryMethodConfig*>( static_cast<internal::RetryMethodConfig*>(((*vector_ptr)[0]).get());
((*vector_ptr)[0]).get());
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->max_attempts(), 2);
EXPECT_EQ(parsed_config->initial_backoff(), 1000); EXPECT_EQ(parsed_config->initial_backoff(), 1000);
@ -1340,8 +1333,7 @@ TEST_F(RetryParserTest,
grpc_slice_from_static_string("/TestServ/TestMethod")); grpc_slice_from_static_string("/TestServ/TestMethod"));
ASSERT_NE(vector_ptr, nullptr); ASSERT_NE(vector_ptr, nullptr);
const auto* parsed_config = const auto* parsed_config =
static_cast<grpc_core::internal::RetryMethodConfig*>( static_cast<internal::RetryMethodConfig*>(((*vector_ptr)[0]).get());
((*vector_ptr)[0]).get());
ASSERT_NE(parsed_config, nullptr); ASSERT_NE(parsed_config, nullptr);
EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->max_attempts(), 2);
EXPECT_EQ(parsed_config->initial_backoff(), 1000); EXPECT_EQ(parsed_config->initial_backoff(), 1000);

@ -25,16 +25,16 @@
namespace grpc_core { namespace grpc_core {
TEST(UsefulTest, ClampWorks) { TEST(UsefulTest, ClampWorks) {
EXPECT_EQ(grpc_core::Clamp(1, 0, 2), 1); EXPECT_EQ(Clamp(1, 0, 2), 1);
EXPECT_EQ(grpc_core::Clamp(0, 0, 2), 0); EXPECT_EQ(Clamp(0, 0, 2), 0);
EXPECT_EQ(grpc_core::Clamp(2, 0, 2), 2); EXPECT_EQ(Clamp(2, 0, 2), 2);
EXPECT_EQ(grpc_core::Clamp(-1, 0, 2), 0); EXPECT_EQ(Clamp(-1, 0, 2), 0);
EXPECT_EQ(grpc_core::Clamp(3, 0, 2), 2); EXPECT_EQ(Clamp(3, 0, 2), 2);
} }
TEST(UsefulTest, Rotate) { TEST(UsefulTest, Rotate) {
EXPECT_EQ(grpc_core::RotateLeft(0x80000001u, 1u), 3); EXPECT_EQ(RotateLeft(0x80000001u, 1u), 3);
EXPECT_EQ(grpc_core::RotateRight(0x80000001u, 1u), 0xc0000000); EXPECT_EQ(RotateRight(0x80000001u, 1u), 0xc0000000);
} }
TEST(UsefulTest, ArraySize) { TEST(UsefulTest, ArraySize) {
@ -48,18 +48,18 @@ TEST(UsefulTest, ArraySize) {
TEST(UsefulTest, BitOps) { TEST(UsefulTest, BitOps) {
uint32_t bitset = 0; uint32_t bitset = 0;
EXPECT_EQ(grpc_core::BitCount((1u << 31) - 1), 31); EXPECT_EQ(BitCount((1u << 31) - 1), 31);
EXPECT_EQ(grpc_core::BitCount(1u << 3), 1); EXPECT_EQ(BitCount(1u << 3), 1);
EXPECT_EQ(grpc_core::BitCount(0), 0); EXPECT_EQ(BitCount(0), 0);
EXPECT_EQ(grpc_core::SetBit(&bitset, 3), 8); EXPECT_EQ(SetBit(&bitset, 3), 8);
EXPECT_EQ(grpc_core::BitCount(bitset), 1); EXPECT_EQ(BitCount(bitset), 1);
EXPECT_EQ(grpc_core::GetBit(bitset, 3), 1); EXPECT_EQ(GetBit(bitset, 3), 1);
EXPECT_EQ(grpc_core::SetBit(&bitset, 1), 10); EXPECT_EQ(SetBit(&bitset, 1), 10);
EXPECT_EQ(grpc_core::BitCount(bitset), 2); EXPECT_EQ(BitCount(bitset), 2);
EXPECT_EQ(grpc_core::ClearBit(&bitset, 3), 2); EXPECT_EQ(ClearBit(&bitset, 3), 2);
EXPECT_EQ(grpc_core::BitCount(bitset), 1); EXPECT_EQ(BitCount(bitset), 1);
EXPECT_EQ(grpc_core::GetBit(bitset, 3), 0); EXPECT_EQ(GetBit(bitset, 3), 0);
EXPECT_EQ(grpc_core::BitCount(std::numeric_limits<uint64_t>::max()), 64); EXPECT_EQ(BitCount(std::numeric_limits<uint64_t>::max()), 64);
} }
} // namespace grpc_core } // namespace grpc_core

@ -46,8 +46,7 @@ TEST(STAT, GetTimestampOnTmpFile) {
fclose(tmp); fclose(tmp);
// Check the last modified date is correctly set. // Check the last modified date is correctly set.
time_t timestamp = 0; time_t timestamp = 0;
absl::Status status = absl::Status status = GetFileModificationTime(tmp_name, &timestamp);
grpc_core::GetFileModificationTime(tmp_name, &timestamp);
EXPECT_EQ(status.code(), absl::StatusCode::kOk); EXPECT_EQ(status.code(), absl::StatusCode::kOk);
EXPECT_GT(timestamp, 0); EXPECT_GT(timestamp, 0);
// Clean up. // Clean up.
@ -57,8 +56,7 @@ TEST(STAT, GetTimestampOnTmpFile) {
TEST(STAT, GetTimestampOnFailure) { TEST(STAT, GetTimestampOnFailure) {
time_t timestamp = 0; time_t timestamp = 0;
absl::Status status = absl::Status status = GetFileModificationTime("/DOES_NOT_EXIST", &timestamp);
grpc_core::GetFileModificationTime("/DOES_NOT_EXIST", &timestamp);
EXPECT_EQ(status.code(), absl::StatusCode::kInternal); EXPECT_EQ(status.code(), absl::StatusCode::kInternal);
// Check the last modified date is not set. // Check the last modified date is not set.
EXPECT_EQ(timestamp, 0); EXPECT_EQ(timestamp, 0);

@ -55,8 +55,7 @@ TEST(AdaptorTest, FactoryFromBindFrontPromise) {
} }
TEST(AdaptorTest, FactoryFromCapturePromise) { TEST(AdaptorTest, FactoryFromCapturePromise) {
EXPECT_EQ(MakeFactory<void>( EXPECT_EQ(MakeFactory<void>(Capture([](int* i) { return Poll<int>(*i); }, 42))
grpc_core::Capture([](int* i) { return Poll<int>(*i); }, 42))
.Once()(), .Once()(),
Poll<int>(42)); Poll<int>(42));
} }

@ -43,7 +43,7 @@ ReclamationPass MapReclamationPass(memory_quota_fuzzer::Reclaimer::Pass pass) {
class Fuzzer { class Fuzzer {
public: public:
void Run(const memory_quota_fuzzer::Msg& msg) { void Run(const memory_quota_fuzzer::Msg& msg) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
RunMsg(msg); RunMsg(msg);
do { do {
memory_quotas_.clear(); memory_quotas_.clear();

File diff suppressed because it is too large Load Diff

@ -61,7 +61,7 @@ namespace {
void AddSamples(BdpEstimator* estimator, int64_t* samples, size_t n) { void AddSamples(BdpEstimator* estimator, int64_t* samples, size_t n) {
estimator->AddIncomingBytes(1234567); estimator->AddIncomingBytes(1234567);
inc_time(); inc_time();
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
estimator->SchedulePing(); estimator->SchedulePing();
estimator->StartPing(); estimator->StartPing();
for (size_t i = 0; i < n; i++) { for (size_t i = 0; i < n; i++) {
@ -69,7 +69,7 @@ void AddSamples(BdpEstimator* estimator, int64_t* samples, size_t n) {
} }
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(1, GPR_TIMESPAN))); gpr_time_from_millis(1, GPR_TIMESPAN)));
grpc_core::ExecCtx::Get()->InvalidateNow(); ExecCtx::Get()->InvalidateNow();
estimator->CompletePing(); estimator->CompletePing();
} }

@ -41,7 +41,7 @@ void NotCalledClosure(void* /*arg*/, grpc_error_handle /*error*/) {
} }
TEST(SliceBufferByteStream, Basic) { TEST(SliceBufferByteStream, Basic) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// Create and populate slice buffer. // Create and populate slice buffer.
grpc_slice_buffer buffer; grpc_slice_buffer buffer;
grpc_slice_buffer_init(&buffer); grpc_slice_buffer_init(&buffer);
@ -73,7 +73,7 @@ TEST(SliceBufferByteStream, Basic) {
} }
TEST(SliceBufferByteStream, Shutdown) { TEST(SliceBufferByteStream, Shutdown) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// Create and populate slice buffer. // Create and populate slice buffer.
grpc_slice_buffer buffer; grpc_slice_buffer buffer;
grpc_slice_buffer_init(&buffer); grpc_slice_buffer_init(&buffer);
@ -117,7 +117,7 @@ TEST(SliceBufferByteStream, Shutdown) {
// //
TEST(CachingByteStream, Basic) { TEST(CachingByteStream, Basic) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// Create and populate slice buffer byte stream. // Create and populate slice buffer byte stream.
grpc_slice_buffer buffer; grpc_slice_buffer buffer;
grpc_slice_buffer_init(&buffer); grpc_slice_buffer_init(&buffer);
@ -152,7 +152,7 @@ TEST(CachingByteStream, Basic) {
} }
TEST(CachingByteStream, Reset) { TEST(CachingByteStream, Reset) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// Create and populate slice buffer byte stream. // Create and populate slice buffer byte stream.
grpc_slice_buffer buffer; grpc_slice_buffer buffer;
grpc_slice_buffer_init(&buffer); grpc_slice_buffer_init(&buffer);
@ -194,7 +194,7 @@ TEST(CachingByteStream, Reset) {
} }
TEST(CachingByteStream, SharedCache) { TEST(CachingByteStream, SharedCache) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
// Create and populate slice buffer byte stream. // Create and populate slice buffer byte stream.
grpc_slice_buffer buffer; grpc_slice_buffer buffer;
grpc_slice_buffer_init(&buffer); grpc_slice_buffer_init(&buffer);

@ -40,7 +40,7 @@ const uint32_t kByteOffset = 123;
void* PhonyArgsCopier(void* arg) { return arg; } void* PhonyArgsCopier(void* arg) { return arg; }
void TestExecuteFlushesListVerifier(void* arg, grpc_core::Timestamps* ts, void TestExecuteFlushesListVerifier(void* arg, Timestamps* ts,
grpc_error_handle error) { grpc_error_handle error) {
ASSERT_NE(arg, nullptr); ASSERT_NE(arg, nullptr);
EXPECT_EQ(error, GRPC_ERROR_NONE); EXPECT_EQ(error, GRPC_ERROR_NONE);
@ -66,14 +66,13 @@ class ContextListTest : public ::testing::Test {
* Also tests that arg and byte_counter are passed correctly. * Also tests that arg and byte_counter are passed correctly.
*/ */
TEST_F(ContextListTest, ExecuteFlushesList) { TEST_F(ContextListTest, ExecuteFlushesList) {
grpc_core::ContextList* list = nullptr; ContextList* list = nullptr;
const int kNumElems = 5; const int kNumElems = 5;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_stream_refcount ref; grpc_stream_refcount ref;
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref"); GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref");
grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write); grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write);
grpc_channel_args* args = grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr);
grpc_core::EnsureResourceQuotaInChannelArgs(nullptr);
grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true); grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true);
grpc_channel_args_destroy(args); grpc_channel_args_destroy(args);
std::vector<grpc_chttp2_stream*> s; std::vector<grpc_chttp2_stream*> s;
@ -88,10 +87,10 @@ TEST_F(ContextListTest, ExecuteFlushesList) {
s[i]->context = &verifier_called[i]; s[i]->context = &verifier_called[i];
s[i]->byte_counter = kByteOffset; s[i]->byte_counter = kByteOffset;
gpr_atm_rel_store(&verifier_called[i], static_cast<gpr_atm>(0)); gpr_atm_rel_store(&verifier_called[i], static_cast<gpr_atm>(0));
grpc_core::ContextList::Append(&list, s[i]); ContextList::Append(&list, s[i]);
} }
grpc_core::Timestamps ts; Timestamps ts;
grpc_core::ContextList::Execute(list, &ts, GRPC_ERROR_NONE); ContextList::Execute(list, &ts, GRPC_ERROR_NONE);
for (auto i = 0; i < kNumElems; i++) { for (auto i = 0; i < kNumElems; i++) {
EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast<gpr_atm>(1)); EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast<gpr_atm>(1));
grpc_transport_destroy_stream(reinterpret_cast<grpc_transport*>(t), grpc_transport_destroy_stream(reinterpret_cast<grpc_transport*>(t),
@ -105,29 +104,28 @@ TEST_F(ContextListTest, ExecuteFlushesList) {
} }
TEST_F(ContextListTest, EmptyList) { TEST_F(ContextListTest, EmptyList) {
grpc_core::ContextList* list = nullptr; ContextList* list = nullptr;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_core::Timestamps ts; Timestamps ts;
grpc_core::ContextList::Execute(list, &ts, GRPC_ERROR_NONE); ContextList::Execute(list, &ts, GRPC_ERROR_NONE);
exec_ctx.Flush(); exec_ctx.Flush();
} }
TEST_F(ContextListTest, EmptyListEmptyTimestamp) { TEST_F(ContextListTest, EmptyListEmptyTimestamp) {
grpc_core::ContextList* list = nullptr; ContextList* list = nullptr;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_core::ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); ContextList::Execute(list, nullptr, GRPC_ERROR_NONE);
exec_ctx.Flush(); exec_ctx.Flush();
} }
TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) { TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) {
grpc_core::ContextList* list = nullptr; ContextList* list = nullptr;
const int kNumElems = 5; const int kNumElems = 5;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_stream_refcount ref; grpc_stream_refcount ref;
GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref"); GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref");
grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write); grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write);
grpc_channel_args* args = grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr);
grpc_core::EnsureResourceQuotaInChannelArgs(nullptr);
grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true); grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true);
grpc_channel_args_destroy(args); grpc_channel_args_destroy(args);
std::vector<grpc_chttp2_stream*> s; std::vector<grpc_chttp2_stream*> s;
@ -142,9 +140,9 @@ TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) {
s[i]->context = &verifier_called[i]; s[i]->context = &verifier_called[i];
s[i]->byte_counter = kByteOffset; s[i]->byte_counter = kByteOffset;
gpr_atm_rel_store(&verifier_called[i], static_cast<gpr_atm>(0)); gpr_atm_rel_store(&verifier_called[i], static_cast<gpr_atm>(0));
grpc_core::ContextList::Append(&list, s[i]); ContextList::Append(&list, s[i]);
} }
grpc_core::ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); ContextList::Execute(list, nullptr, GRPC_ERROR_NONE);
for (auto i = 0; i < kNumElems; i++) { for (auto i = 0; i < kNumElems; i++) {
EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast<gpr_atm>(1)); EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast<gpr_atm>(1));
grpc_transport_destroy_stream(reinterpret_cast<grpc_transport*>(t), grpc_transport_destroy_stream(reinterpret_cast<grpc_transport*>(t),

@ -47,7 +47,7 @@ void AssertIndex(const HPackTable* tbl, uint32_t idx, const char* key,
} // namespace } // namespace
TEST(HpackParserTableTest, StaticTable) { TEST(HpackParserTableTest, StaticTable) {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
HPackTable tbl; HPackTable tbl;
AssertIndex(&tbl, 1, ":authority", ""); AssertIndex(&tbl, 1, ":authority", "");
@ -117,7 +117,7 @@ TEST(HpackParserTableTest, ManyAdditions) {
HPackTable tbl; HPackTable tbl;
int i; int i;
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
for (i = 0; i < 100000; i++) { for (i = 0; i < 100000; i++) {
grpc_mdelem elem; grpc_mdelem elem;
@ -126,13 +126,13 @@ TEST(HpackParserTableTest, ManyAdditions) {
elem = grpc_mdelem_from_slices(grpc_slice_from_cpp_string(key), elem = grpc_mdelem_from_slices(grpc_slice_from_cpp_string(key),
grpc_slice_from_cpp_string(value)); grpc_slice_from_cpp_string(value));
ASSERT_EQ(tbl.Add(HPackTable::Memento(elem)), GRPC_ERROR_NONE); ASSERT_EQ(tbl.Add(HPackTable::Memento(elem)), GRPC_ERROR_NONE);
AssertIndex(&tbl, 1 + grpc_core::hpack_constants::kLastStaticEntry, AssertIndex(&tbl, 1 + hpack_constants::kLastStaticEntry, key.c_str(),
key.c_str(), value.c_str()); value.c_str());
if (i) { if (i) {
std::string key = absl::StrCat("K.", i - 1); std::string key = absl::StrCat("K.", i - 1);
std::string value = absl::StrCat("VALUE.", i - 1); std::string value = absl::StrCat("VALUE.", i - 1);
AssertIndex(&tbl, 2 + grpc_core::hpack_constants::kLastStaticEntry, AssertIndex(&tbl, 2 + hpack_constants::kLastStaticEntry, key.c_str(),
key.c_str(), value.c_str()); value.c_str());
} }
} }
} }

@ -29,7 +29,7 @@ static void VerifyAsciiHeaderSize(const char* key, const char* value,
grpc_mdelem elem = grpc_mdelem_from_slices( grpc_mdelem elem = grpc_mdelem_from_slices(
maybe_intern(grpc_slice_from_static_string(key), intern_key), maybe_intern(grpc_slice_from_static_string(key), intern_key),
maybe_intern(grpc_slice_from_static_string(value), intern_value)); maybe_intern(grpc_slice_from_static_string(value), intern_value));
size_t elem_size = grpc_core::MetadataSizeInHPackTable(elem, false); size_t elem_size = MetadataSizeInHPackTable(elem, false);
size_t expected_size = 32 + strlen(key) + strlen(value); size_t expected_size = 32 + strlen(key) + strlen(value);
GPR_ASSERT(expected_size == elem_size); GPR_ASSERT(expected_size == elem_size);
GRPC_MDELEM_UNREF(elem); GRPC_MDELEM_UNREF(elem);
@ -43,7 +43,7 @@ static void VerifyBinaryHeaderSize(const char* key, const uint8_t* value,
maybe_intern(grpc_slice_from_static_buffer(value, value_len), maybe_intern(grpc_slice_from_static_buffer(value, value_len),
intern_value)); intern_value));
GPR_ASSERT(grpc_is_binary_header(GRPC_MDKEY(elem))); GPR_ASSERT(grpc_is_binary_header(GRPC_MDKEY(elem)));
size_t elem_size = grpc_core::MetadataSizeInHPackTable(elem, false); size_t elem_size = MetadataSizeInHPackTable(elem, false);
grpc_slice value_slice = grpc_slice_from_copied_buffer( grpc_slice value_slice = grpc_slice_from_copied_buffer(
reinterpret_cast<const char*>(value), value_len); reinterpret_cast<const char*>(value), value_len);
grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice); grpc_slice base64_encoded = grpc_chttp2_base64_encode(value_slice);
@ -69,7 +69,7 @@ TEST_P(MetadataTest, MetadataSize) {
gpr_log(GPR_INFO, "test_mdelem_size: intern_key=%d intern_value=%d", gpr_log(GPR_INFO, "test_mdelem_size: intern_key=%d intern_value=%d",
intern_key, intern_value); intern_key, intern_value);
grpc_init(); grpc_init();
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
uint8_t binary_value[BUFFER_SIZE] = {0}; uint8_t binary_value[BUFFER_SIZE] = {0};
for (uint8_t i = 0; i < BUFFER_SIZE; i++) { for (uint8_t i = 0; i < BUFFER_SIZE; i++) {

@ -108,7 +108,7 @@ class Client {
: server_address_(server_address) {} : server_address_(server_address) {}
void Connect() { void Connect() {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_resolved_addresses* server_addresses = nullptr; grpc_resolved_addresses* server_addresses = nullptr;
grpc_error_handle error = grpc_error_handle error =
grpc_blocking_resolve_address(server_address_, "80", &server_addresses); grpc_blocking_resolve_address(server_address_, "80", &server_addresses);
@ -119,11 +119,10 @@ class Client {
grpc_pollset_set* pollset_set = grpc_pollset_set_create(); grpc_pollset_set* pollset_set = grpc_pollset_set_create();
grpc_pollset_set_add_pollset(pollset_set, pollset_); grpc_pollset_set_add_pollset(pollset_set, pollset_);
EventState state; EventState state;
grpc_channel_args* args = grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr);
grpc_core::EnsureResourceQuotaInChannelArgs(nullptr);
grpc_tcp_client_connect(state.closure(), &endpoint_, pollset_set, args, grpc_tcp_client_connect(state.closure(), &endpoint_, pollset_set, args,
server_addresses->addrs, server_addresses->addrs,
grpc_core::ExecCtx::Get()->Now() + 1000); ExecCtx::Get()->Now() + 1000);
grpc_channel_args_destroy(args); grpc_channel_args_destroy(args);
ASSERT_TRUE(PollUntilDone( ASSERT_TRUE(PollUntilDone(
&state, &state,
@ -137,13 +136,13 @@ class Client {
// Reads until an error is returned. // Reads until an error is returned.
// Returns true if an error was encountered before the deadline. // Returns true if an error was encountered before the deadline.
bool ReadUntilError() { bool ReadUntilError() {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_slice_buffer read_buffer; grpc_slice_buffer read_buffer;
grpc_slice_buffer_init(&read_buffer); grpc_slice_buffer_init(&read_buffer);
bool retval = true; bool retval = true;
// Use a deadline of 3 seconds, which is a lot more than we should // Use a deadline of 3 seconds, which is a lot more than we should
// need for a 1-second timeout, but this helps avoid flakes. // need for a 1-second timeout, but this helps avoid flakes.
grpc_millis deadline = grpc_core::ExecCtx::Get()->Now() + 3000; grpc_millis deadline = ExecCtx::Get()->Now() + 3000;
while (true) { while (true) {
EventState state; EventState state;
grpc_endpoint_read(endpoint_, &read_buffer, state.closure(), grpc_endpoint_read(endpoint_, &read_buffer, state.closure(),
@ -163,7 +162,7 @@ class Client {
} }
void Shutdown() { void Shutdown() {
grpc_core::ExecCtx exec_ctx; ExecCtx exec_ctx;
grpc_endpoint_destroy(endpoint_); grpc_endpoint_destroy(endpoint_);
grpc_pollset_shutdown(pollset_, grpc_pollset_shutdown(pollset_,
GRPC_CLOSURE_CREATE(&Client::PollsetDestroy, pollset_, GRPC_CLOSURE_CREATE(&Client::PollsetDestroy, pollset_,
@ -209,13 +208,12 @@ class Client {
gpr_mu_lock(mu_); gpr_mu_lock(mu_);
GRPC_LOG_IF_ERROR( GRPC_LOG_IF_ERROR(
"grpc_pollset_work", "grpc_pollset_work",
grpc_pollset_work(pollset_, &worker, grpc_pollset_work(pollset_, &worker, ExecCtx::Get()->Now() + 100));
grpc_core::ExecCtx::Get()->Now() + 100));
// Flushes any work scheduled before or during polling. // Flushes any work scheduled before or during polling.
grpc_core::ExecCtx::Get()->Flush(); ExecCtx::Get()->Flush();
gpr_mu_unlock(mu_); gpr_mu_unlock(mu_);
if (state != nullptr && state->done()) return true; if (state != nullptr && state->done()) return true;
if (grpc_core::ExecCtx::Get()->Now() >= deadline) return false; if (ExecCtx::Get()->Now() >= deadline) return false;
} }
} }

@ -103,7 +103,7 @@ std::string GetCurrentStackTrace() {
void InitializeStackTracer(const char* argv0) { void InitializeStackTracer(const char* argv0) {
absl::InitializeSymbolizer(argv0); absl::InitializeSymbolizer(argv0);
grpc_core::SetCurrentStackTraceProvider(&GetCurrentStackTrace); SetCurrentStackTraceProvider(&GetCurrentStackTrace);
} }
} // namespace testing } // namespace testing

@ -128,9 +128,8 @@ void AsyncExternalVerifier::Destruct(void* user_data) {
auto* self = static_cast<AsyncExternalVerifier*>(user_data); auto* self = static_cast<AsyncExternalVerifier*>(user_data);
// Spawn a detached thread to destroy the verifier, to make sure that we don't // Spawn a detached thread to destroy the verifier, to make sure that we don't
// try to join the worker thread from within the worker thread. // try to join the worker thread from within the worker thread.
grpc_core::Thread destroy_thread( Thread destroy_thread("DestroyExternalVerifier", DestroyExternalVerifier,
"DestroyExternalVerifier", DestroyExternalVerifier, self, nullptr, self, nullptr, Thread::Options().set_joinable(false));
grpc_core::Thread::Options().set_joinable(false));
destroy_thread.Start(); destroy_thread.Start();
} }

@ -125,7 +125,7 @@ class AsyncExternalVerifier {
static void WorkerThread(void* arg); static void WorkerThread(void* arg);
bool success_ = false; bool success_ = false;
grpc_core::Thread thread_; Thread thread_;
grpc_tls_certificate_verifier_external base_; grpc_tls_certificate_verifier_external base_;
Mutex mu_; Mutex mu_;
std::deque<Request> queue_ ABSL_GUARDED_BY(mu_); std::deque<Request> queue_ ABSL_GUARDED_BY(mu_);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save