diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc index 82205181af1..31a084cd40e 100644 --- a/src/core/ext/filters/client_channel/client_channel_plugin.cc +++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc @@ -66,8 +66,7 @@ void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) { GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, [](grpc_channel_stack_builder* builder) { return grpc_channel_stack_builder_append_filter( - builder, &grpc_core::ClientChannel::kFilterVtable, nullptr, - nullptr); + builder, &ClientChannel::kFilterVtable, nullptr, nullptr); }); } diff --git a/src/core/ext/filters/client_channel/dynamic_filters.cc b/src/core/ext/filters/client_channel/dynamic_filters.cc index 8e7f5db2c87..aac97725726 100644 --- a/src/core/ext/filters/client_channel/dynamic_filters.cc +++ b/src/core/ext/filters/client_channel/dynamic_filters.cc @@ -79,7 +79,7 @@ RefCountedPtr DynamicFilters::Call::Ref() { } RefCountedPtr DynamicFilters::Call::Ref( - const grpc_core::DebugLocation& location, const char* reason) { + const DebugLocation& location, const char* reason) { IncrementRefCount(location, reason); return RefCountedPtr(this); } @@ -112,8 +112,8 @@ void DynamicFilters::Call::IncrementRefCount() { GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), ""); } -void DynamicFilters::Call::IncrementRefCount( - const grpc_core::DebugLocation& /*location*/, const char* reason) { +void DynamicFilters::Call::IncrementRefCount(const DebugLocation& /*location*/, + const char* reason) { GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), reason); } diff --git a/src/core/ext/filters/client_channel/health/health_check_client.h b/src/core/ext/filters/client_channel/health/health_check_client.h index b20e8d845f5..86e2fd2eaba 100644 --- a/src/core/ext/filters/client_channel/health/health_check_client.h +++ b/src/core/ext/filters/client_channel/health/health_check_client.h @@ -94,7 +94,7 @@ class HealthCheckClient : public InternallyRefCounted { grpc_polling_entity pollent_; Arena* arena_; - grpc_core::CallCombiner call_combiner_; + CallCombiner call_combiner_; grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {}; // The streaming call to the backend. Always non-null. diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc index 4140f6ce0b3..8fbd09fee68 100644 --- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc +++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc @@ -139,12 +139,11 @@ void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error_handle error) { void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg, grpc_error_handle error) { auto* handshaker = static_cast(arg); - grpc_core::ExecCtx::Run( - DEBUG_LOCATION, - GRPC_CLOSURE_INIT(&handshaker->request_done_closure_, - &HttpConnectHandshaker::OnWriteDone, handshaker, - grpc_schedule_on_exec_ctx), - GRPC_ERROR_REF(error)); + ExecCtx::Run(DEBUG_LOCATION, + GRPC_CLOSURE_INIT(&handshaker->request_done_closure_, + &HttpConnectHandshaker::OnWriteDone, + handshaker, grpc_schedule_on_exec_ctx), + GRPC_ERROR_REF(error)); } // Callback invoked when finished writing HTTP CONNECT request. @@ -174,12 +173,11 @@ void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error_handle error) { void HttpConnectHandshaker::OnReadDoneScheduler(void* arg, grpc_error_handle error) { auto* handshaker = static_cast(arg); - grpc_core::ExecCtx::Run( - DEBUG_LOCATION, - GRPC_CLOSURE_INIT(&handshaker->response_read_closure_, - &HttpConnectHandshaker::OnReadDone, handshaker, - grpc_schedule_on_exec_ctx), - GRPC_ERROR_REF(error)); + ExecCtx::Run(DEBUG_LOCATION, + GRPC_CLOSURE_INIT(&handshaker->response_read_closure_, + &HttpConnectHandshaker::OnReadDone, handshaker, + grpc_schedule_on_exec_ctx), + GRPC_ERROR_REF(error)); } // Callback invoked for reading HTTP CONNECT response. @@ -385,8 +383,8 @@ class HttpConnectHandshakerFactory : public HandshakerFactory { void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) { builder->handshaker_registry()->RegisterHandshakerFactory( - true /* at_start */, grpc_core::HANDSHAKER_CLIENT, - absl::make_unique()); + true /* at_start */, HANDSHAKER_CLIENT, + absl::make_unique()); } } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 489d153c8e2..f90634d8b30 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1322,8 +1322,7 @@ grpc_channel_args* BuildBalancerChannelArgs( absl::InlinedVector args_to_add = { // The fake resolver response generator, which we use to inject // address updates into the LB channel. - grpc_core::FakeResolverResponseGenerator::MakeChannelArg( - response_generator), + FakeResolverResponseGenerator::MakeChannelArg(response_generator), // A channel arg indicating the target is a grpclb load balancer. grpc_channel_arg_integer_create( const_cast(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1), diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc index e7b5d288651..bf25138e2f0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc @@ -63,8 +63,7 @@ void GrpcLbClientStats::AddCallDropped(const char* token) { } } // Not found, so add a new entry. - drop_token_counts_->emplace_back( - grpc_core::UniquePtr(gpr_strdup(token)), 1); + drop_token_counts_->emplace_back(UniquePtr(gpr_strdup(token)), 1); } namespace { diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h index a1d77bd2d6b..bfa030da876 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h @@ -34,10 +34,10 @@ namespace grpc_core { class GrpcLbClientStats : public RefCounted { public: struct DropTokenCount { - grpc_core::UniquePtr token; + UniquePtr token; int64_t count; - DropTokenCount(grpc_core::UniquePtr token, int64_t count) + DropTokenCount(UniquePtr token, int64_t count) : token(std::move(token)), count(count) {} }; diff --git a/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc b/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc index 3f954f2d4db..2d00fd29f5a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +++ b/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc @@ -747,9 +747,8 @@ class RingHashFactory : public LoadBalancingPolicyFactory { } // namespace void GrpcLbPolicyRingHashInit() { - grpc_core::LoadBalancingPolicyRegistry::Builder:: - RegisterLoadBalancingPolicyFactory( - absl::make_unique()); + LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory( + absl::make_unique()); } void GrpcLbPolicyRingHashShutdown() {} diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc index 5998c36038c..432d52b4877 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc @@ -595,14 +595,13 @@ void XdsClusterResolverLb::UpdateLocked(UpdateArgs args) { DiscoveryMechanismEntry entry; if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism:: DiscoveryMechanismType::EDS) { - entry.discovery_mechanism = - grpc_core::MakeOrphanable( - Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"), - discovery_mechanisms_.size()); + entry.discovery_mechanism = MakeOrphanable( + Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"), + discovery_mechanisms_.size()); } else if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism:: DiscoveryMechanismType::LOGICAL_DNS) { entry.discovery_mechanism = - grpc_core::MakeOrphanable( + MakeOrphanable( Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism"), discovery_mechanisms_.size()); } else { diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index 68624cdbad3..bc73ab3b686 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -398,10 +398,10 @@ void AresDnsResolver::MaybeStartResolvingLocked() { const grpc_millis earliest_next_resolution = last_resolution_timestamp_ + min_time_between_resolutions_; 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) { const grpc_millis last_resolution_ago = - grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_; + ExecCtx::Get()->Now() - last_resolution_timestamp_; GRPC_CARES_TRACE_LOG( "resolver:%p In cooldown from last resolution (from %" PRId64 " ms ago). Will resolve again in %" PRId64 " ms", @@ -434,7 +434,7 @@ void AresDnsResolver::StartResolvingLocked() { enable_srv_queries_ ? &balancer_addresses_ : nullptr, request_service_config_ ? &service_config_json_ : nullptr, 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", this, pending_request_); } diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h index 01fe1796613..41b3ae0dba4 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h @@ -60,13 +60,13 @@ class GrpcPolledFdFactory { /* Creates a new wrapped fd for the current platform */ virtual GrpcPolledFd* NewGrpcPolledFdLocked( ares_socket_t as, grpc_pollset_set* driver_pollset_set, - std::shared_ptr work_serializer) = 0; + std::shared_ptr work_serializer) = 0; /* Optionally configures the ares channel after creation */ virtual void ConfigureAresChannelLocked(ares_channel channel) = 0; }; std::unique_ptr NewGrpcPolledFdFactory( - std::shared_ptr work_serializer); + std::shared_ptr work_serializer); } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc index 33b78b62fc3..d05c7097c8b 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc @@ -133,12 +133,12 @@ class GrpcPolledFdWindows { } 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; } 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; } diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc index 3a8bc71ce5a..c1bda75f78d 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -239,10 +239,10 @@ void NativeDnsResolver::MaybeStartResolvingLocked() { const grpc_millis earliest_next_resolution = last_resolution_timestamp_ + min_time_between_resolutions_; 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) { const grpc_millis last_resolution_ago = - grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_; + ExecCtx::Get()->Now() - last_resolution_timestamp_; gpr_log(GPR_DEBUG, "In cooldown from last resolution (from %" PRId64 " ms ago). Will resolve again in %" PRId64 " ms", @@ -277,7 +277,7 @@ void NativeDnsResolver::StartResolvingLocked() { grpc_schedule_on_exec_ctx); grpc_resolve_address(name_to_resolve_.c_str(), kDefaultSecurePort, interested_parties_, &on_resolved_, &addresses_); - last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now(); + last_resolution_timestamp_ = ExecCtx::Get()->Now(); } // diff --git a/src/core/ext/filters/client_channel/resolver_registry.cc b/src/core/ext/filters/client_channel/resolver_registry.cc index b1d0ee21a59..d1de8903287 100644 --- a/src/core/ext/filters/client_channel/resolver_registry.cc +++ b/src/core/ext/filters/client_channel/resolver_registry.cc @@ -104,7 +104,7 @@ class RegistryState { // hurting performance (which is unlikely, since these allocations // only occur at gRPC initialization time). absl::InlinedVector, 10> factories_; - grpc_core::UniquePtr default_prefix_; + UniquePtr default_prefix_; }; static RegistryState* g_state = nullptr; @@ -181,15 +181,14 @@ std::string ResolverRegistry::GetDefaultAuthority(absl::string_view target) { return authority; } -grpc_core::UniquePtr ResolverRegistry::AddDefaultPrefixIfNeeded( - const char* target) { +UniquePtr ResolverRegistry::AddDefaultPrefixIfNeeded(const char* target) { GPR_ASSERT(g_state != nullptr); URI uri; std::string canonical_target; g_state->FindResolverFactory(target, &uri, &canonical_target); - return grpc_core::UniquePtr(canonical_target.empty() - ? gpr_strdup(target) - : gpr_strdup(canonical_target.c_str())); + return UniquePtr(canonical_target.empty() + ? gpr_strdup(target) + : gpr_strdup(canonical_target.c_str())); } } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/resolver_registry.h b/src/core/ext/filters/client_channel/resolver_registry.h index f2e5b9c195f..26f8ea288d8 100644 --- a/src/core/ext/filters/client_channel/resolver_registry.h +++ b/src/core/ext/filters/client_channel/resolver_registry.h @@ -76,8 +76,7 @@ class ResolverRegistry { static std::string GetDefaultAuthority(absl::string_view target); /// Returns \a target with the default prefix prepended, if needed. - static grpc_core::UniquePtr AddDefaultPrefixIfNeeded( - const char* target); + static UniquePtr AddDefaultPrefixIfNeeded(const char* target); /// Returns the resolver factory for \a scheme. /// Caller does NOT own the return value. diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index 39ded508411..7b5ee2aeb01 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -188,8 +188,8 @@ RefCountedPtr SubchannelCall::Ref() { return RefCountedPtr(this); } -RefCountedPtr SubchannelCall::Ref( - const grpc_core::DebugLocation& location, const char* reason) { +RefCountedPtr SubchannelCall::Ref(const DebugLocation& location, + const char* reason) { IncrementRefCount(location, reason); return RefCountedPtr(this); } @@ -287,8 +287,8 @@ void SubchannelCall::IncrementRefCount() { GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), ""); } -void SubchannelCall::IncrementRefCount( - const grpc_core::DebugLocation& /*location*/, const char* reason) { +void SubchannelCall::IncrementRefCount(const DebugLocation& /*location*/, + const char* reason) { GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason); } diff --git a/src/core/ext/filters/fault_injection/fault_injection_filter.cc b/src/core/ext/filters/fault_injection/fault_injection_filter.cc index 2a9a9bedcac..bf861d05a4f 100644 --- a/src/core/ext/filters/fault_injection/fault_injection_filter.cc +++ b/src/core/ext/filters/fault_injection/fault_injection_filter.cc @@ -495,7 +495,7 @@ extern const grpc_channel_filter FaultInjectionFilterVtable = { }; void FaultInjectionFilterInit(void) { - grpc_core::FaultInjectionServiceConfigParser::Register(); + FaultInjectionServiceConfigParser::Register(); } void FaultInjectionFilterShutdown(void) {} diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc index dac830d4628..08fa1685d7a 100644 --- a/src/core/ext/filters/http/http_filters_plugin.cc +++ b/src/core/ext/filters/http/http_filters_plugin.cc @@ -76,13 +76,11 @@ void RegisterHttpFilters(CoreConfiguration::Builder* builder) { optional(GRPC_SERVER_CHANNEL, false, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION, &grpc_message_compress_filter); optional(GRPC_CLIENT_SUBCHANNEL, true, - GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, - &grpc_core::MessageDecompressFilter); + GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter); optional(GRPC_CLIENT_DIRECT_CHANNEL, true, - GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, - &grpc_core::MessageDecompressFilter); + GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter); 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_DIRECT_CHANNEL, &grpc_http_client_filter); required(GRPC_SERVER_CHANNEL, &grpc_http_server_filter); diff --git a/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc b/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc index 0f54ad52959..25988fdbbdb 100644 --- a/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +++ b/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc @@ -84,7 +84,7 @@ class CallData { void MaybeResumeRecvTrailingMetadataReady(); grpc_call_context_element* call_context_; - grpc_core::CallCombiner* call_combiner_; + CallCombiner* call_combiner_; ServiceConfigCallData service_config_call_data_; // Overall error for the call grpc_error_handle error_ = GRPC_ERROR_NONE; diff --git a/src/core/ext/transport/binder/client/binder_connector.cc b/src/core/ext/transport/binder/client/binder_connector.cc index 9e1090437c7..dbd72475d49 100644 --- a/src/core/ext/transport/binder/client/binder_connector.cc +++ b/src/core/ext/transport/binder/client/binder_connector.cc @@ -113,8 +113,7 @@ class BinderConnector : public grpc_core::SubchannelConnector { namespace grpc_core { -grpc_core::RefCountedPtr -BinderClientChannelFactory::CreateSubchannel( +RefCountedPtr BinderClientChannelFactory::CreateSubchannel( const grpc_resolved_address& address, const grpc_channel_args* args) { gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this); grpc_arg default_authority_arg = grpc_channel_arg_string_create( @@ -123,9 +122,8 @@ BinderClientChannelFactory::CreateSubchannel( grpc_channel_args* new_args = grpc_channel_args_copy_and_add(args, &default_authority_arg, 1); - grpc_core::RefCountedPtr s = - grpc_core::Subchannel::Create( - grpc_core::MakeOrphanable(), address, new_args); + RefCountedPtr s = + Subchannel::Create(MakeOrphanable(), address, new_args); return s; } diff --git a/src/core/ext/transport/binder/client/binder_connector.h b/src/core/ext/transport/binder/client/binder_connector.h index a5fd6f0f7ed..6b350fa2667 100644 --- a/src/core/ext/transport/binder/client/binder_connector.h +++ b/src/core/ext/transport/binder/client/binder_connector.h @@ -32,9 +32,9 @@ namespace grpc_core { -class BinderClientChannelFactory : public grpc_core::ClientChannelFactory { +class BinderClientChannelFactory : public ClientChannelFactory { public: - grpc_core::RefCountedPtr CreateSubchannel( + RefCountedPtr CreateSubchannel( const grpc_resolved_address& address, const grpc_channel_args* args) override; }; diff --git a/src/core/ext/transport/binder/server/binder_server.cc b/src/core/ext/transport/binder/server/binder_server.cc index ade40aa2c93..fc459c77b4e 100644 --- a/src/core/ext/transport/binder/server/binder_server.cc +++ b/src/core/ext/transport/binder/server/binder_server.cc @@ -173,7 +173,7 @@ class BinderServerListener : public Server::ListenerInterface { private: absl::Status OnSetupTransport(transaction_code_t code, grpc_binder::ReadableParcel* parcel, int uid) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; if (grpc_binder::BinderTransportTxCode(code) != grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT) { return absl::InvalidArgumentError("Not a SETUP_TRANSPORT request"); @@ -238,11 +238,10 @@ bool AddBinderPort(const std::string& addr, grpc_server* server, return false; } 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( - grpc_core::OrphanablePtr( - new grpc_core::BinderServerListener( - core_server, conn_id, std::move(factory), security_policy))); + OrphanablePtr(new BinderServerListener( + core_server, conn_id, std::move(factory), security_policy))); return true; } diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc index b15f16d2fee..e3097504276 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc @@ -53,7 +53,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args, return nullptr; } // Add channel arg containing the server URI. - grpc_core::UniquePtr canonical_target = + UniquePtr canonical_target = ResolverRegistry::AddDefaultPrefixIfNeeded(target); grpc_arg arg = grpc_channel_arg_string_create( const_cast(GRPC_ARG_SERVER_URI), canonical_target.get()); diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc index 8287bf389e1..74f80e8cc2e 100644 --- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc @@ -113,7 +113,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args, return nullptr; } // Add channel arg containing the server URI. - grpc_core::UniquePtr canonical_target = + UniquePtr canonical_target = ResolverRegistry::AddDefaultPrefixIfNeeded(target); grpc_arg arg = grpc_channel_arg_string_create( const_cast(GRPC_ARG_SERVER_URI), canonical_target.get()); diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 40ba48a7595..01347000c93 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -821,8 +821,8 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr, "Invalid address: addr cannot be a nullptr."); } if (strncmp(addr, "external:", 9) == 0) { - return grpc_core::Chttp2ServerListener::CreateWithAcceptor( - server, addr, args, args_modifier); + return Chttp2ServerListener::CreateWithAcceptor(server, addr, args, + args_modifier); } *port_num = -1; grpc_resolved_addresses* resolved = nullptr; @@ -852,9 +852,9 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr, grpc_sockaddr_set_port(&resolved->addrs[i], *port_num); } int port_temp = -1; - error = grpc_core::Chttp2ServerListener::Create( - server, &resolved->addrs[i], grpc_channel_args_copy(args), - args_modifier, &port_temp); + error = Chttp2ServerListener::Create(server, &resolved->addrs[i], + grpc_channel_args_copy(args), + args_modifier, &port_temp); if (error != GRPC_ERROR_NONE) { error_list.push_back(error); } else { diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 3a9b14c554b..0e3eccb1a19 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -2991,11 +2991,10 @@ void Chttp2IncomingByteStream::NextLocked(void* arg, grpc_slice_buffer_swap(&s->frame_storage, &s->unprocessed_incoming_frames_buffer); s->unprocessed_incoming_frames_decompressed = false; - grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, - GRPC_ERROR_NONE); + ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, GRPC_ERROR_NONE); } else if (s->byte_stream_error != GRPC_ERROR_NONE) { - grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, - GRPC_ERROR_REF(s->byte_stream_error)); + ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, + GRPC_ERROR_REF(s->byte_stream_error)); if (s->data_parser.parsing_frame != nullptr) { s->data_parser.parsing_frame->Unref(); s->data_parser.parsing_frame = nullptr; @@ -3004,8 +3003,8 @@ void Chttp2IncomingByteStream::NextLocked(void* arg, if (bs->remaining_bytes_ != 0) { s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( "Truncated message", &s->read_closed_error, 1); - grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, - GRPC_ERROR_REF(s->byte_stream_error)); + ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, + GRPC_ERROR_REF(s->byte_stream_error)); if (s->data_parser.parsing_frame != nullptr) { s->data_parser.parsing_frame->Unref(); s->data_parser.parsing_frame = nullptr; @@ -3093,8 +3092,7 @@ grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) { void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) { GPR_ASSERT(error != GRPC_ERROR_NONE); - grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, - GRPC_ERROR_REF(error)); + ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, GRPC_ERROR_REF(error)); stream_->on_next = nullptr; GRPC_ERROR_UNREF(stream_->byte_stream_error); stream_->byte_stream_error = GRPC_ERROR_REF(error); diff --git a/src/core/ext/transport/chttp2/transport/context_list.cc b/src/core/ext/transport/chttp2/transport/context_list.cc index afb18abc238..70e3774699d 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.cc +++ b/src/core/ext/transport/chttp2/transport/context_list.cc @@ -40,8 +40,7 @@ void ContextList::Append(ContextList** head, grpc_chttp2_stream* s) { *head = elem; } -void ContextList::Execute(void* arg, grpc_core::Timestamps* ts, - grpc_error_handle error) { +void ContextList::Execute(void* arg, Timestamps* ts, grpc_error_handle error) { ContextList* head = static_cast(arg); ContextList* to_be_freed; while (head != nullptr) { @@ -58,7 +57,7 @@ void ContextList::Execute(void* arg, grpc_core::Timestamps* ts, } 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; } diff --git a/src/core/ext/transport/chttp2/transport/context_list.h b/src/core/ext/transport/chttp2/transport/context_list.h index 0e39ff1155d..f4963d849cb 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.h +++ b/src/core/ext/transport/chttp2/transport/context_list.h @@ -35,8 +35,7 @@ class ContextList { /* 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 * and hence does not take a ref on \a error */ - static void Execute(void* arg, grpc_core::Timestamps* ts, - grpc_error_handle error); + static void Execute(void* arg, Timestamps* ts, grpc_error_handle error); private: void* trace_context_ = nullptr; @@ -45,7 +44,7 @@ class ContextList { }; 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*)); } /* namespace grpc_core */ diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index aeb5a817264..c269be2d0c2 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -331,10 +331,10 @@ class TransportFlowControl final : public TransportFlowControlBase { const bool enable_bdp_probe_; /* bdp estimation */ - grpc_core::BdpEstimator bdp_estimator_; + BdpEstimator bdp_estimator_; /* pid controller */ - grpc_core::PidController pid_controller_; + PidController pid_controller_; grpc_millis last_pid_update_ = 0; }; diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index 5dfd11d9968..fe0910adba4 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -420,13 +420,11 @@ void HPackCompressor::Framer::EncodeDynamic(grpc_mdelem elem) { uint32_t elem_hash = 0; if (elem_interned) { // Update filter to see if we can perhaps add this elem. - elem_hash = GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED - ? reinterpret_cast( - GRPC_MDELEM_DATA(elem)) - ->hash() - : reinterpret_cast( - GRPC_MDELEM_DATA(elem)) - ->hash(); + elem_hash = + GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED + ? reinterpret_cast(GRPC_MDELEM_DATA(elem)) + ->hash() + : reinterpret_cast(GRPC_MDELEM_DATA(elem))->hash(); bool can_add_to_hashtable = compressor_->filter_elems_.AddElement(elem_hash % kNumFilterValues); /* 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? */ 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 = decoder_space_usage < kMaxDecoderSpaceUsage; const bool should_add_elem = @@ -491,10 +489,9 @@ void HPackCompressor::Framer::Encode(GrpcTimeoutMetadata, grpc_millis deadline) { char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; grpc_mdelem mdelem; - grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(), - timeout_str); - mdelem = grpc_mdelem_from_slices( - GRPC_MDSTR_GRPC_TIMEOUT, grpc_core::UnmanagedMemorySlice(timeout_str)); + grpc_http2_encode_timeout(deadline - ExecCtx::Get()->Now(), timeout_str); + mdelem = grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TIMEOUT, + UnmanagedMemorySlice(timeout_str)); EncodeDynamic(mdelem); GRPC_MDELEM_UNREF(mdelem); } @@ -533,8 +530,7 @@ HPackCompressor::Framer::Framer(const EncodeHeaderOptions& options, void HPackCompressor::Framer::Encode(grpc_mdelem md) { if (GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC) { const uintptr_t static_index = - reinterpret_cast(GRPC_MDELEM_DATA(md)) - ->StaticIndex(); + reinterpret_cast(GRPC_MDELEM_DATA(md))->StaticIndex(); if (static_index < hpack_constants::kLastStaticEntry) { EmitIndexed(static_cast(static_index + 1)); return; diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index 547da351baf..172578d2854 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -238,7 +238,7 @@ class HPackCompressor { class KeySliceRef { public: - using Stored = grpc_core::RefCountedPtr; + using Stored = RefCountedPtr; KeySliceRef(grpc_slice_refcount* ref, uint32_t hash) : ref_(ref), hash_(hash) {} diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 2f68464a7ac..e9e6ef143a7 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -259,7 +259,7 @@ class Chttp2IncomingByteStream : public ByteStream { grpc_chttp2_transport* transport_; // 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 application thread when stream->pending_byte_stream == diff --git a/src/core/ext/xds/certificate_provider_store.h b/src/core/ext/xds/certificate_provider_store.h index b6095e2822b..943b1daa314 100644 --- a/src/core/ext/xds/certificate_provider_store.h +++ b/src/core/ext/xds/certificate_provider_store.h @@ -74,7 +74,7 @@ class CertificateProviderStore store_->ReleaseCertificateProvider(key_, this); } - grpc_core::RefCountedPtr distributor() + RefCountedPtr distributor() const override { return certificate_provider_->distributor(); } diff --git a/src/core/ext/xds/xds_certificate_provider.h b/src/core/ext/xds/xds_certificate_provider.h index 2f508830f76..3e57b86d919 100644 --- a/src/core/ext/xds/xds_certificate_provider.h +++ b/src/core/ext/xds/xds_certificate_provider.h @@ -34,8 +34,7 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider { XdsCertificateProvider(); ~XdsCertificateProvider() override; - grpc_core::RefCountedPtr distributor() - const override { + RefCountedPtr distributor() const override { return distributor_; } diff --git a/src/core/ext/xds/xds_channel_stack_modifier.cc b/src/core/ext/xds/xds_channel_stack_modifier.cc index 3fd5c5867b9..bdf7e21aa5b 100644 --- a/src/core/ext/xds/xds_channel_stack_modifier.cc +++ b/src/core/ext/xds/xds_channel_stack_modifier.cc @@ -99,10 +99,9 @@ XdsChannelStackModifier::GetFromChannelArgs(const grpc_channel_args& args) { void RegisterXdsChannelStackModifier(CoreConfiguration::Builder* builder) { builder->channel_init()->RegisterStage( GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) { - grpc_core::RefCountedPtr - channel_stack_modifier = - XdsChannelStackModifier::GetFromChannelArgs( - *grpc_channel_stack_builder_get_channel_arguments(builder)); + RefCountedPtr channel_stack_modifier = + XdsChannelStackModifier::GetFromChannelArgs( + *grpc_channel_stack_builder_get_channel_arguments(builder)); if (channel_stack_modifier != nullptr) { return channel_stack_modifier->ModifyChannelStack(builder); } diff --git a/src/core/ext/xds/xds_client.cc b/src/core/ext/xds/xds_client.cc index ce07f0392ba..4444d2c4009 100644 --- a/src/core/ext/xds/xds_client.cc +++ b/src/core/ext/xds/xds_client.cc @@ -85,7 +85,7 @@ class XdsClient::Notifier { template static void ScheduleNotifyWatchersOnErrorInWorkSerializer( XdsClient* xds_client, const T& watchers_list, grpc_error_handle error, - const grpc_core::DebugLocation& location) { + const DebugLocation& location) { xds_client->work_serializer_.Schedule( [watchers_list, error]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) { @@ -103,7 +103,7 @@ class XdsClient::Notifier { template static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer( XdsClient* xds_client, const T& watchers_list, - const grpc_core::DebugLocation& location) { + const DebugLocation& location) { xds_client->work_serializer_.Schedule( [watchers_list]() 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()); GRPC_ERROR_UNREF(result.parse_error); } else { - grpc_millis update_time = grpc_core::ExecCtx::Get()->Now(); + grpc_millis update_time = ExecCtx::Get()->Now(); // Update nonce. auto& state = state_map_[result.type_url]; state.nonce = std::move(result.nonce); @@ -2793,7 +2793,7 @@ namespace { std::string GetBootstrapContents(const char* fallback_config, grpc_error_handle* error) { // First, try GRPC_XDS_BOOTSTRAP env var. - grpc_core::UniquePtr path(gpr_getenv("GRPC_XDS_BOOTSTRAP")); + UniquePtr path(gpr_getenv("GRPC_XDS_BOOTSTRAP")); if (path != nullptr) { if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { gpr_log(GPR_INFO, @@ -2810,8 +2810,7 @@ std::string GetBootstrapContents(const char* fallback_config, return contents_str; } // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var. - grpc_core::UniquePtr env_config( - gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG")); + UniquePtr env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG")); if (env_config != nullptr) { if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { gpr_log(GPR_INFO, diff --git a/src/core/lib/backoff/backoff.cc b/src/core/lib/backoff/backoff.cc index 68bef770201..edca1de4ce5 100644 --- a/src/core/lib/backoff/backoff.cc +++ b/src/core/lib/backoff/backoff.cc @@ -55,7 +55,7 @@ BackOff::BackOff(const Options& options) grpc_millis BackOff::NextAttemptTime() { if (initial_) { initial_ = false; - return current_backoff_ + grpc_core::ExecCtx::Get()->Now(); + return current_backoff_ + ExecCtx::Get()->Now(); } current_backoff_ = static_cast( std::min(current_backoff_ * options_.multiplier(), @@ -65,7 +65,7 @@ grpc_millis BackOff::NextAttemptTime() { options_.jitter() * current_backoff_); const grpc_millis next_timeout = static_cast(current_backoff_ + jitter); - return next_timeout + grpc_core::ExecCtx::Get()->Now(); + return next_timeout + ExecCtx::Get()->Now(); } void BackOff::Reset() { diff --git a/src/core/lib/channel/channel_trace.cc b/src/core/lib/channel/channel_trace.cc index f5a825c0b29..9015d0fb2e1 100644 --- a/src/core/lib/channel/channel_trace.cc +++ b/src/core/lib/channel/channel_trace.cc @@ -46,8 +46,8 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data, RefCountedPtr referenced_entity) : severity_(severity), data_(data), - timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), - GPR_CLOCK_REALTIME)), + timestamp_( + grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)), next_(nullptr), referenced_entity_(std::move(referenced_entity)), 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) : severity_(severity), data_(data), - timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), - GPR_CLOCK_REALTIME)), + timestamp_( + grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)), next_(nullptr), 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 } gpr_mu_init(&tracer_mu_); - time_created_ = grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(), - GPR_CLOCK_REALTIME); + time_created_ = + grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME); } ChannelTrace::~ChannelTrace() { diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc index 37dca3e2b0b..fa78e9895f4 100644 --- a/src/core/lib/channel/channelz.cc +++ b/src/core/lib/channel/channelz.cc @@ -398,7 +398,7 @@ void SecurityArgDestroy(void* p) { 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 = { SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp}; diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index d788541b577..91d15b3f010 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -56,7 +56,7 @@ class TraceFlagList { }; namespace testing { -void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag); +void grpc_tracer_enable_flag(TraceFlag* flag); } class TraceFlag { @@ -90,7 +90,7 @@ class TraceFlag { #endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */ private: - friend void grpc_core::testing::grpc_tracer_enable_flag(TraceFlag* flag); + friend void testing::grpc_tracer_enable_flag(TraceFlag* flag); friend class TraceFlagList; void set_enabled(bool enabled) { diff --git a/src/core/lib/gprpp/global_config_env.cc b/src/core/lib/gprpp/global_config_env.cc index d70c8e839aa..db12867f488 100644 --- a/src/core/lib/gprpp/global_config_env.cc +++ b/src/core/lib/gprpp/global_config_env.cc @@ -58,8 +58,8 @@ void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func) { g_global_config_env_error_func = func; } -grpc_core::UniquePtr GlobalConfigEnv::GetValue() { - return grpc_core::UniquePtr(gpr_getenv(GetName())); +UniquePtr GlobalConfigEnv::GetValue() { + return UniquePtr(gpr_getenv(GetName())); } void GlobalConfigEnv::SetValue(const char* value) { @@ -80,7 +80,7 @@ static_assert(std::is_trivially_destructible::value, "GlobalConfigEnvBool needs to be trivially destructible."); bool GlobalConfigEnvBool::Get() { - grpc_core::UniquePtr str = GetValue(); + UniquePtr str = GetValue(); if (str == nullptr) { return default_value_; } @@ -101,7 +101,7 @@ static_assert(std::is_trivially_destructible::value, "GlobalConfigEnvInt32 needs to be trivially destructible."); int32_t GlobalConfigEnvInt32::Get() { - grpc_core::UniquePtr str = GetValue(); + UniquePtr str = GetValue(); if (str == nullptr) { return default_value_; } @@ -124,10 +124,10 @@ void GlobalConfigEnvInt32::Set(int32_t value) { static_assert(std::is_trivially_destructible::value, "GlobalConfigEnvString needs to be trivially destructible."); -grpc_core::UniquePtr GlobalConfigEnvString::Get() { - grpc_core::UniquePtr str = GetValue(); +UniquePtr GlobalConfigEnvString::Get() { + UniquePtr str = GetValue(); if (str == nullptr) { - return grpc_core::UniquePtr(gpr_strdup(default_value_)); + return UniquePtr(gpr_strdup(default_value_)); } return str; } diff --git a/src/core/lib/gprpp/global_config_env.h b/src/core/lib/gprpp/global_config_env.h index b6d7d574ecf..3d3038895d3 100644 --- a/src/core/lib/gprpp/global_config_env.h +++ b/src/core/lib/gprpp/global_config_env.h @@ -43,7 +43,7 @@ class GlobalConfigEnv { public: // Returns the value of `name` variable. - grpc_core::UniquePtr GetValue(); + UniquePtr GetValue(); // Sets the value of `name` variable. void SetValue(const char* value); @@ -87,7 +87,7 @@ class GlobalConfigEnvString : public GlobalConfigEnv { constexpr GlobalConfigEnvString(char* name, const char* default_value) : GlobalConfigEnv(name), default_value_(default_value) {} - grpc_core::UniquePtr Get(); + UniquePtr Get(); void Set(const char* value); private: diff --git a/src/core/lib/gprpp/manual_constructor.h b/src/core/lib/gprpp/manual_constructor.h index 49517af034a..6ef55570357 100644 --- a/src/core/lib/gprpp/manual_constructor.h +++ b/src/core/lib/gprpp/manual_constructor.h @@ -163,9 +163,8 @@ class PolymorphicManualConstructor { } typename std::aligned_storage< - grpc_core::manual_ctor_impl::max_size_of::value, - grpc_core::manual_ctor_impl::max_align_of::value>::type - space_; + manual_ctor_impl::max_size_of::value, + manual_ctor_impl::max_align_of::value>::type space_; }; template diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index 7fade1cf7dc..bdd26d562b2 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -117,7 +117,7 @@ class InternallyRefCounted : public Orphanable { refs_.Ref(location, reason); } - grpc_core::RefCount refs_; + RefCount refs_; }; } // namespace grpc_core diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index f250bbd79ac..733ec5e9383 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -208,7 +208,7 @@ class PolymorphicRefCount { }; // 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. class NonPolymorphicRefCount { public: diff --git a/src/core/lib/gprpp/status_helper.h b/src/core/lib/gprpp/status_helper.h index a6704328036..801736d24ed 100644 --- a/src/core/lib/gprpp/status_helper.h +++ b/src/core/lib/gprpp/status_helper.h @@ -160,7 +160,7 @@ google_rpc_Status* StatusToProto(const absl::Status& status, /// This is for internal implementation & test only 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; /// Returns ptr where the given status is copied into. diff --git a/src/core/lib/http/httpcli.cc b/src/core/lib/http/httpcli.cc index 1efdc372ed1..1f821ce6f23 100644 --- a/src/core/lib/http/httpcli.cc +++ b/src/core/lib/http/httpcli.cc @@ -98,7 +98,7 @@ class InternalRequest { private: void Finish(grpc_error_handle error) { 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; } diff --git a/src/core/lib/iomgr/buffer_list.cc b/src/core/lib/iomgr/buffer_list.cc index 0ea6af25ba1..e332301e488 100644 --- a/src/core/lib/iomgr/buffer_list.cc +++ b/src/core/lib/iomgr/buffer_list.cc @@ -40,14 +40,14 @@ void fill_gpr_from_timestamp(gpr_timespec* gts, const struct timespec* ts) { 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*/) { gpr_log(GPR_DEBUG, "Timestamps callback has not been registered"); } /** The saved callback function that will be invoked when we get all the * 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) = 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 */ void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics, - const grpc_core::tcp_info* info) { + const tcp_info* info) { if (info == nullptr) { 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->is_delivery_rate_app_limited.emplace( 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->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_retx.emplace(info->tcpi_bytes_retrans); 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)); - info->length = offsetof(grpc_core::tcp_info, length); + info->length = offsetof(tcp_info, length); return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &(info->length)); } } /* namespace */ @@ -286,7 +286,7 @@ void TracedBuffer::Shutdown(TracedBuffer** head, void* remaining, } 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; } } /* namespace grpc_core */ @@ -295,7 +295,7 @@ void grpc_tcp_set_write_timestamps_callback( namespace grpc_core { 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. // Can't comment out the name because some compilers and formatters don't // like the sequence */* , which would arise from */*fn*/. diff --git a/src/core/lib/iomgr/buffer_list.h b/src/core/lib/iomgr/buffer_list.h index f09bbe1d1b8..29c54dee4ac 100644 --- a/src/core/lib/iomgr/buffer_list.h +++ b/src/core/lib/iomgr/buffer_list.h @@ -96,8 +96,8 @@ struct Timestamps { uint32_t byte_offset; /* byte offset relative to the start of the RPC */ #ifdef GRPC_LINUX_ERRQUEUE - grpc_core::tcp_info info; /* tcp_info collected on sendmsg */ -#endif /* GRPC_LINUX_ERRQUEUE */ + tcp_info info; /* tcp_info collected on sendmsg */ +#endif /* GRPC_LINUX_ERRQUEUE */ }; /** TracedBuffer is a class to keep track of timestamps for a specific buffer in @@ -105,7 +105,7 @@ struct Timestamps { * this class would only be used by Linux platforms. For all other platforms, * 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. * * 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 * sendmsg_time with the current timestamp. */ - static void AddNewEntry(grpc_core::TracedBuffer** head, uint32_t seq_no, - int fd, void* arg); + static void AddNewEntry(TracedBuffer** head, uint32_t seq_no, int fd, + void* arg); /** Processes a received timestamp based on sock_extended_err and * scm_timestamping structures. It will invoke the timestamps callback if the * timestamp type is SCM_TSTAMP_ACK. */ - static void ProcessTimestamp(grpc_core::TracedBuffer** head, + static void ProcessTimestamp(TracedBuffer** head, struct sock_extended_err* serr, struct cmsghdr* opt_stats, struct scm_timestamping* tss); /** Cleans the list by calling the callback for each traced buffer in the list * 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); private: - uint32_t seq_no_; /* The sequence number for the last byte in the buffer */ - void* arg_; /* The arg to pass to timestamps_callback */ - grpc_core::Timestamps ts_; /* The timestamps corresponding to this buffer */ - grpc_core::TracedBuffer* next_; /* The next TracedBuffer in the list */ + uint32_t seq_no_; /* The sequence number for the last byte in the buffer */ + void* arg_; /* The arg to pass to timestamps_callback */ + Timestamps ts_; /* The timestamps corresponding to this buffer */ + TracedBuffer* next_; /* The next TracedBuffer in the list */ }; #else /* GRPC_LINUX_ERRQUEUE */ class TracedBuffer { public: /* 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_UNREF(shutdown_err); } @@ -156,7 +156,7 @@ class TracedBuffer { /** Sets the callback function to call when timestamps for a write are * collected. The callback does not own a reference to error. */ 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 */ diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index 7137bcaa583..830e1e856f8 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -91,8 +91,7 @@ void CallCombiner::TsanClosure(void* arg, grpc_error_handle error) { } else { lock.reset(); } - grpc_core::Closure::Run(DEBUG_LOCATION, self->original_closure_, - GRPC_ERROR_REF(error)); + Closure::Run(DEBUG_LOCATION, self->original_closure_, GRPC_ERROR_REF(error)); if (lock != nullptr) { TSAN_ANNOTATE_RWLOCK_RELEASED(&lock->taken, true); bool prev = true; diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h index 1465c5a4394..a427100ef84 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -73,10 +73,10 @@ class Combiner; * 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 : * - * grpc_core::ExecCtx exec_ctx; + * ExecCtx exec_ctx; * * Access the created ExecCtx instance using : - * grpc_core::ExecCtx::Get() + * ExecCtx::Get() * * Specific responsibilities (this may grow in the future): * - 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 * heap allocated. * - 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 * ExecCtx on a thread's stack at the same time. The TODO below * discusses this plan in more detail. @@ -108,14 +108,14 @@ class ExecCtx { /** Default Constructor */ ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) { - grpc_core::Fork::IncExecCtxCount(); + Fork::IncExecCtxCount(); Set(this); } /** Parameterised Constructor */ explicit ExecCtx(uintptr_t fl) : flags_(fl) { if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { - grpc_core::Fork::IncExecCtxCount(); + Fork::IncExecCtxCount(); } Set(this); } @@ -126,7 +126,7 @@ class ExecCtx { Flush(); Set(last_exec_ctx_); 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 * not be invoked until other core work is done and other application callbacks * have completed. To accomplish this, any application callback should be - * enqueued using grpc_core::ApplicationCallbackExecCtx::Enqueue . + * enqueued using ApplicationCallbackExecCtx::Enqueue . * * CONVENTIONS: * - 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 * will have the following declarations: * - * grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; - * grpc_core::ExecCtx exec_ctx; + * ApplicationCallbackExecCtx callback_exec_ctx; + * ExecCtx exec_ctx; * * This ordering is important to make sure that the ApplicationCallbackExecCtx * is destroyed after the ExecCtx (to prevent the re-entry problem described @@ -320,7 +320,7 @@ class ApplicationCallbackExecCtx { } callback_exec_ctx_ = nullptr; if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { - grpc_core::Fork::DecExecCtxCount(); + Fork::DecExecCtxCount(); } } else { GPR_DEBUG_ASSERT(head_ == nullptr); @@ -335,7 +335,7 @@ class ApplicationCallbackExecCtx { static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) { if (Get() == nullptr) { if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) { - grpc_core::Fork::IncExecCtxCount(); + Fork::IncExecCtxCount(); } callback_exec_ctx_ = exec_ctx; } diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index 4ef0c34a2ce..08665968976 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -108,7 +108,7 @@ size_t Executor::RunClosures(const char* executor_name, // invoked on its destruction, which will be after completing any closures in // the executor's closure list (which were explicitly scheduled onto the // executor). - grpc_core::ApplicationCallbackExecCtx callback_exec_ctx( + ApplicationCallbackExecCtx callback_exec_ctx( GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD); grpc_closure* c = list.head; @@ -126,7 +126,7 @@ size_t Executor::RunClosures(const char* executor_name, GRPC_ERROR_UNREF(error); c = next; n++; - grpc_core::ExecCtx::Get()->Flush(); + ExecCtx::Get()->Flush(); } return n; @@ -156,12 +156,11 @@ void Executor::SetThreading(bool threading) { gpr_cv_init(&thd_state_[i].cv); thd_state_[i].id = i; 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_[0].thd = - grpc_core::Thread(name_, &Executor::ThreadMain, &thd_state_[0]); + thd_state_[0].thd = Thread(name_, &Executor::ThreadMain, &thd_state_[0]); thd_state_[0].thd.Start(); } else { // !threading 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 // an application. // 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(); } @@ -215,7 +214,7 @@ void Executor::ThreadMain(void* arg) { ThreadState* ts = static_cast(arg); 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; for (;;) { @@ -242,7 +241,7 @@ void Executor::ThreadMain(void* arg) { EXECUTOR_TRACE("(%s) [%" PRIdPTR "]: execute", ts->name, ts->id); - grpc_core::ExecCtx::Get()->InvalidateNow(); + ExecCtx::Get()->InvalidateNow(); subtract_depth = RunClosures(ts->name, closures); } @@ -267,8 +266,7 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error, #else EXECUTOR_TRACE("(%s) schedule %p inline", name_, closure); #endif - grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), - closure, error); + grpc_closure_list_append(ExecCtx::Get()->closure_list(), closure, error); return; } @@ -278,8 +276,7 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error, ThreadState* ts = g_this_thread_state; if (ts == nullptr) { - ts = &thd_state_[grpc_core::HashPointer(grpc_core::ExecCtx::Get(), - cur_thread_count)]; + ts = &thd_state_[HashPointer(ExecCtx::Get(), cur_thread_count)]; } 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') gpr_atm_rel_store(&num_threads_, cur_thread_count + 1); - thd_state_[cur_thread_count].thd = grpc_core::Thread( - name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]); + thd_state_[cur_thread_count].thd = + Thread(name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]); thd_state_[cur_thread_count].thd.Start(); } gpr_spinlock_unlock(&adding_thread_lock_); diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h index 37e5c1e57e1..2b18d8424ae 100644 --- a/src/core/lib/iomgr/executor.h +++ b/src/core/lib/iomgr/executor.h @@ -36,7 +36,7 @@ struct ThreadState { size_t depth; // Number of closures in the closure list bool shutdown; bool queued_long_job; - grpc_core::Thread thd; + Thread thd; }; enum class ExecutorType { diff --git a/src/core/lib/iomgr/work_serializer.cc b/src/core/lib/iomgr/work_serializer.cc index a396c035951..3af315ccb1f 100644 --- a/src/core/lib/iomgr/work_serializer.cc +++ b/src/core/lib/iomgr/work_serializer.cc @@ -26,17 +26,14 @@ DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer"); class WorkSerializer::WorkSerializerImpl : public Orphanable { public: - void Run(std::function callback, - const grpc_core::DebugLocation& location); - void Schedule(std::function callback, - const grpc_core::DebugLocation& location); + void Run(std::function callback, const DebugLocation& location); + void Schedule(std::function callback, const DebugLocation& location); void DrainQueue(); void Orphan() override; private: struct CallbackWrapper { - CallbackWrapper(std::function cb, - const grpc_core::DebugLocation& loc) + CallbackWrapper(std::function cb, const DebugLocation& loc) : callback(std::move(cb)), location(loc) {} MultiProducerSingleConsumerQueue::Node mpscq_node; @@ -75,8 +72,8 @@ class WorkSerializer::WorkSerializerImpl : public Orphanable { MultiProducerSingleConsumerQueue queue_; }; -void WorkSerializer::WorkSerializerImpl::Run( - std::function callback, const grpc_core::DebugLocation& location) { +void WorkSerializer::WorkSerializerImpl::Run(std::function callback, + const DebugLocation& location) { if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]", this, location.file(), location.line()); @@ -108,7 +105,7 @@ void WorkSerializer::WorkSerializerImpl::Run( } void WorkSerializer::WorkSerializerImpl::Schedule( - std::function callback, const grpc_core::DebugLocation& location) { + std::function callback, const DebugLocation& location) { CallbackWrapper* cb_wrapper = new CallbackWrapper(std::move(callback), location); if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { @@ -215,12 +212,12 @@ WorkSerializer::WorkSerializer() WorkSerializer::~WorkSerializer() {} void WorkSerializer::Run(std::function callback, - const grpc_core::DebugLocation& location) { + const DebugLocation& location) { impl_->Run(std::move(callback), location); } void WorkSerializer::Schedule(std::function callback, - const grpc_core::DebugLocation& location) { + const DebugLocation& location) { impl_->Schedule(std::move(callback), location); } diff --git a/src/core/lib/iomgr/work_serializer.h b/src/core/lib/iomgr/work_serializer.h index 8fa70a7a660..217018cf362 100644 --- a/src/core/lib/iomgr/work_serializer.h +++ b/src/core/lib/iomgr/work_serializer.h @@ -72,15 +72,13 @@ class ABSL_LOCKABLE WorkSerializer { // } // 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. - void Run(std::function callback, - const grpc_core::DebugLocation& location); + void Run(std::function callback, const DebugLocation& location); // Schedule \a callback to be run later when the queue of callbacks is // drained. - void Schedule(std::function callback, - const grpc_core::DebugLocation& location); + void Schedule(std::function callback, const DebugLocation& location); // Drains the queue of callbacks. void DrainQueue(); diff --git a/src/core/lib/json/json_util.cc b/src/core/lib/json/json_util.cc index ed1de9a6efc..3aff1824051 100644 --- a/src/core/lib/json/json_util.cc +++ b/src/core/lib/json/json_util.cc @@ -30,7 +30,7 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration) { if (field.type() != Json::Type::STRING) return false; size_t len = field.string_value().size(); if (field.string_value()[len - 1] != 's') return false; - grpc_core::UniquePtr buf(gpr_strdup(field.string_value().c_str())); + UniquePtr buf(gpr_strdup(field.string_value().c_str())); *(buf.get() + len - 1) = '\0'; // Remove trailing 's'. char* decimal_point = strchr(buf.get(), '.'); int nanos = 0; diff --git a/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc b/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc index c7236aac409..267b94d3cc9 100644 --- a/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc +++ b/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc @@ -110,7 +110,7 @@ FileWatcherAuthorizationPolicyProvider::FileWatcherAuthorizationPolicyProvider( } } }; - refresh_thread_ = absl::make_unique( + refresh_thread_ = absl::make_unique( "FileWatcherAuthorizationPolicyProvider_refreshing_thread", thread_lambda, WeakRef().release()); refresh_thread_->Start(); @@ -130,7 +130,7 @@ absl::Status FileWatcherAuthorizationPolicyProvider::ForceUpdate() { if (!rbac_policies_or.ok()) { return rbac_policies_or.status(); } - grpc_core::MutexLock lock(&mu_); + MutexLock lock(&mu_); allow_engine_ = MakeRefCounted( std::move(rbac_policies_or->allow_policy)); deny_engine_ = MakeRefCounted( diff --git a/src/core/lib/security/authorization/grpc_authorization_policy_provider.h b/src/core/lib/security/authorization/grpc_authorization_policy_provider.h index 44b74a37895..e897e6b1c51 100644 --- a/src/core/lib/security/authorization/grpc_authorization_policy_provider.h +++ b/src/core/lib/security/authorization/grpc_authorization_policy_provider.h @@ -77,7 +77,7 @@ class FileWatcherAuthorizationPolicyProvider void Orphan() override; AuthorizationEngines engines() override { - grpc_core::MutexLock lock(&mu_); + MutexLock lock(&mu_); return {allow_engine_, deny_engine_}; } @@ -92,7 +92,7 @@ class FileWatcherAuthorizationPolicyProvider std::unique_ptr refresh_thread_; gpr_event shutdown_event_; - grpc_core::Mutex mu_; + Mutex mu_; // Engines created using authz_policy_. RefCountedPtr allow_engine_ ABSL_GUARDED_BY(mu_); RefCountedPtr deny_engine_ ABSL_GUARDED_BY(mu_); diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc index 2a34bcaf81e..9de2a363029 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc @@ -439,9 +439,9 @@ void set_gce_tenancy_checker_for_testing(grpc_gce_tenancy_checker checker) { } void grpc_flush_cached_google_default_credentials(void) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; 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; } diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc index f9132578b99..f654e284f8d 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc @@ -182,7 +182,7 @@ grpc_call_credentials* grpc_service_account_jwt_access_credentials_create( namespace grpc_core { absl::StatusOr RemoveServiceNameFromJwtUri(absl::string_view uri) { - auto parsed = grpc_core::URI::Parse(uri); + auto parsed = URI::Parse(uri); if (!parsed.ok()) { return parsed.status(); } diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index a00cb4ac37e..16c7278a439 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -584,8 +584,8 @@ class StsTokenFetcherCredentials channel. This would allow us to cancel an authentication query when under extreme memory pressure. */ grpc_httpcli_post( - http_context, pollent, grpc_core::ResourceQuota::Default(), &request, - body, body_length, deadline, + http_context, pollent, ResourceQuota::Default(), &request, body, + body_length, deadline, GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req, grpc_schedule_on_exec_ctx), &metadata_req->response); @@ -636,14 +636,14 @@ class StsTokenFetcherCredentials URI sts_url_; grpc_closure http_post_cb_closure_; - grpc_core::UniquePtr resource_; - grpc_core::UniquePtr audience_; - grpc_core::UniquePtr scope_; - grpc_core::UniquePtr requested_token_type_; - grpc_core::UniquePtr subject_token_path_; - grpc_core::UniquePtr subject_token_type_; - grpc_core::UniquePtr actor_token_path_; - grpc_core::UniquePtr actor_token_type_; + UniquePtr resource_; + UniquePtr audience_; + UniquePtr scope_; + UniquePtr requested_token_type_; + UniquePtr subject_token_path_; + UniquePtr subject_token_type_; + UniquePtr actor_token_path_; + UniquePtr actor_token_type_; }; } // namespace diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc index 65357eaa32b..9ee718067f3 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc @@ -31,17 +31,16 @@ namespace grpc_core { StaticDataCertificateProvider::StaticDataCertificateProvider( - std::string root_certificate, - grpc_core::PemKeyCertPairList pem_key_cert_pairs) + std::string root_certificate, PemKeyCertPairList pem_key_cert_pairs) : distributor_(MakeRefCounted()), root_certificate_(std::move(root_certificate)), pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) { distributor_->SetWatchStatusCallback([this](std::string cert_name, bool root_being_watched, bool identity_being_watched) { - grpc_core::MutexLock lock(&mu_); + MutexLock lock(&mu_); absl::optional root_certificate; - absl::optional pem_key_cert_pairs; + absl::optional pem_key_cert_pairs; StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name]; if (!info.root_being_watched && root_being_watched && !root_certificate_.empty()) { @@ -123,15 +122,15 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider( provider->ForceUpdate(); } }; - refresh_thread_ = grpc_core::Thread( - "FileWatcherCertificateProvider_refreshing_thread", thread_lambda, this); + refresh_thread_ = Thread("FileWatcherCertificateProvider_refreshing_thread", + thread_lambda, this); refresh_thread_.Start(); distributor_->SetWatchStatusCallback([this](std::string cert_name, bool root_being_watched, bool identity_being_watched) { - grpc_core::MutexLock lock(&mu_); + MutexLock lock(&mu_); absl::optional root_certificate; - absl::optional pem_key_cert_pairs; + absl::optional pem_key_cert_pairs; FileWatcherCertificateProvider::WatcherInfo& info = watcher_info_[cert_name]; if (!info.root_being_watched && root_being_watched && @@ -180,7 +179,7 @@ FileWatcherCertificateProvider::~FileWatcherCertificateProvider() { void FileWatcherCertificateProvider::ForceUpdate() { absl::optional root_certificate; - absl::optional pem_key_cert_pairs; + absl::optional pem_key_cert_pairs; if (!root_cert_path_.empty()) { root_certificate = ReadRootCertificatesFromFile(root_cert_path_); } @@ -188,7 +187,7 @@ void FileWatcherCertificateProvider::ForceUpdate() { pem_key_cert_pairs = ReadIdentityKeyCertPairFromFiles( private_key_path_, identity_certificate_path_); } - grpc_core::MutexLock lock(&mu_); + MutexLock lock(&mu_); const bool root_cert_changed = (!root_certificate.has_value() && !root_certificate_.empty()) || (root_certificate.has_value() && root_certificate_ != *root_certificate); @@ -221,7 +220,7 @@ void FileWatcherCertificateProvider::ForceUpdate() { const std::string& cert_name = p.first; const WatcherInfo& info = p.second; absl::optional root_to_report; - absl::optional identity_to_report; + absl::optional identity_to_report; // Set key materials to the distributor if their contents changed. if (info.root_being_watched && !root_certificate_.empty() && root_cert_changed) { @@ -279,7 +278,7 @@ namespace { // it logs the error and returns 0. time_t GetModificationTime(const char* filename) { time_t ts = 0; - absl::Status status = grpc_core::GetFileModificationTime(filename, &ts); + absl::Status status = GetFileModificationTime(filename, &ts); return ts; } diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h index 707e97f7d98..7edb960ec58 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h @@ -59,9 +59,8 @@ namespace grpc_core { class StaticDataCertificateProvider final : public grpc_tls_certificate_provider { public: - StaticDataCertificateProvider( - std::string root_certificate, - grpc_core::PemKeyCertPairList pem_key_cert_pairs); + StaticDataCertificateProvider(std::string root_certificate, + PemKeyCertPairList pem_key_cert_pairs); ~StaticDataCertificateProvider() override; @@ -76,9 +75,9 @@ class StaticDataCertificateProvider final }; RefCountedPtr distributor_; std::string root_certificate_; - grpc_core::PemKeyCertPairList pem_key_cert_pairs_; + PemKeyCertPairList pem_key_cert_pairs_; // Guards members below. - grpc_core::Mutex mu_; + Mutex mu_; // Stores each cert_name we get from the distributor callback and its watcher // information. std::map watcher_info_; @@ -122,15 +121,15 @@ class FileWatcherCertificateProvider final unsigned int refresh_interval_sec_ = 0; RefCountedPtr distributor_; - grpc_core::Thread refresh_thread_; + Thread refresh_thread_; gpr_event shutdown_event_; // Guards members below. - grpc_core::Mutex mu_; + Mutex mu_; // The most-recent credential data. It will be empty if the most recent read // attempt failed. 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 // information. std::map watcher_info_ ABSL_GUARDED_BY(mu_); diff --git a/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/src/core/lib/security/security_connector/alts/alts_security_connector.cc index 131436dfe9d..2222991b223 100644 --- a/src/core/lib/security/security_connector/alts/alts_security_connector.cc +++ b/src/core/lib/security/security_connector/alts/alts_security_connector.cc @@ -187,8 +187,8 @@ class grpc_alts_server_security_connector final namespace grpc_core { namespace internal { -grpc_core::RefCountedPtr -grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) { +RefCountedPtr grpc_alts_auth_context_from_tsi_peer( + const tsi_peer* peer) { if (peer == nullptr) { gpr_log(GPR_ERROR, "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; } /* Create auth context. */ - auto ctx = grpc_core::MakeRefCounted(nullptr); + auto ctx = MakeRefCounted(nullptr); grpc_auth_context_add_cstring_property( ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME, GRPC_ALTS_TRANSPORT_SECURITY_TYPE); diff --git a/src/core/lib/security/security_connector/alts/alts_security_connector.h b/src/core/lib/security/security_connector/alts/alts_security_connector.h index 10c3fe93646..a857196edc5 100644 --- a/src/core/lib/security/security_connector/alts/alts_security_connector.h +++ b/src/core/lib/security/security_connector/alts/alts_security_connector.h @@ -66,8 +66,8 @@ namespace grpc_core { namespace internal { /* Exposed only for testing. */ -grpc_core::RefCountedPtr -grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer); +RefCountedPtr grpc_alts_auth_context_from_tsi_peer( + const tsi_peer* peer); } // namespace internal } // namespace grpc_core diff --git a/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc b/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc index 360764e136a..858d9f54293 100644 --- a/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +++ b/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc @@ -95,7 +95,7 @@ int InsecureChannelSecurityConnector::cmp( // created with the security level of TSI_SECURITY_NONE. void InsecureServerSecurityConnector::add_handshakers( const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */, - grpc_core::HandshakeManager* handshake_manager) { + HandshakeManager* handshake_manager) { tsi_handshaker* handshaker = nullptr; // Re-use local_tsi_handshaker_create as a minimalist handshaker. GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */, &handshaker) == @@ -105,7 +105,7 @@ void InsecureServerSecurityConnector::add_handshakers( void InsecureServerSecurityConnector::check_peer( tsi_peer peer, grpc_endpoint* /*ep*/, - grpc_core::RefCountedPtr* auth_context, + RefCountedPtr* auth_context, grpc_closure* on_peer_checked) { *auth_context = MakeAuthContext(); tsi_peer_destruct(&peer); diff --git a/src/core/lib/security/security_connector/insecure/insecure_security_connector.h b/src/core/lib/security/security_connector/insecure/insecure_security_connector.h index 352e346c1aa..ef888079efd 100644 --- a/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +++ b/src/core/lib/security/security_connector/insecure/insecure_security_connector.h @@ -39,8 +39,8 @@ class InsecureChannelSecurityConnector : public grpc_channel_security_connector { public: InsecureChannelSecurityConnector( - grpc_core::RefCountedPtr channel_creds, - grpc_core::RefCountedPtr request_metadata_creds) + RefCountedPtr channel_creds, + RefCountedPtr request_metadata_creds) : grpc_channel_security_connector(/* url_scheme */ nullptr, std::move(channel_creds), std::move(request_metadata_creds)) {} @@ -54,10 +54,10 @@ class InsecureChannelSecurityConnector void add_handshakers(const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */, - grpc_core::HandshakeManager* handshake_manager) override; + HandshakeManager* handshake_manager) override; void check_peer(tsi_peer peer, grpc_endpoint* ep, - grpc_core::RefCountedPtr* auth_context, + RefCountedPtr* auth_context, grpc_closure* on_peer_checked) override; void cancel_check_peer(grpc_closure* /*on_peer_checked*/, @@ -71,16 +71,16 @@ class InsecureChannelSecurityConnector class InsecureServerSecurityConnector : public grpc_server_security_connector { public: explicit InsecureServerSecurityConnector( - grpc_core::RefCountedPtr server_creds) + RefCountedPtr server_creds) : grpc_server_security_connector(nullptr /* url_scheme */, std::move(server_creds)) {} void add_handshakers(const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */, - grpc_core::HandshakeManager* handshake_manager) override; + HandshakeManager* handshake_manager) override; void check_peer(tsi_peer peer, grpc_endpoint* ep, - grpc_core::RefCountedPtr* auth_context, + RefCountedPtr* auth_context, grpc_closure* on_peer_checked) override; void cancel_check_peer(grpc_closure* /*on_peer_checked*/, diff --git a/src/core/lib/security/security_connector/load_system_roots_linux.cc b/src/core/lib/security/security_connector/load_system_roots_linux.cc index da311da7156..6b9c50b7182 100644 --- a/src/core/lib/security/security_connector/load_system_roots_linux.cc +++ b/src/core/lib/security/security_connector/load_system_roots_linux.cc @@ -145,8 +145,7 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) { grpc_slice LoadSystemRootCerts() { grpc_slice result = grpc_empty_slice(); // Prioritize user-specified custom directory if flag is set. - grpc_core::UniquePtr custom_dir = - GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir); + UniquePtr custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir); if (strlen(custom_dir.get()) > 0) { result = CreateRootCertsBundle(custom_dir.get()); } diff --git a/src/core/lib/security/security_connector/ssl_utils.cc b/src/core/lib/security/security_connector/ssl_utils.cc index 81972c2b085..e24d346d209 100644 --- a/src/core/lib/security/security_connector/ssl_utils.cc +++ b/src/core/lib/security/security_connector/ssl_utils.cc @@ -563,7 +563,7 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() { const bool not_use_system_roots = GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots); // First try to load the roots from the configuration. - grpc_core::UniquePtr default_root_certs_path = + UniquePtr default_root_certs_path = GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path); if (strlen(default_root_certs_path.get()) > 0) { GRPC_LOG_IF_ERROR( diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index 1c41a5434cb..f7e747c460d 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -181,7 +181,7 @@ class PemKeyCertPair { std::string cert_chain_; }; -typedef absl::InlinedVector PemKeyCertPairList; +typedef absl::InlinedVector PemKeyCertPairList; } // namespace grpc_core diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 0f9114d8f22..c95f7cb2430 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -440,7 +440,7 @@ grpc_error_handle SecurityHandshaker::DoHandshakerNextLocked( void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler( void* arg, grpc_error_handle error) { SecurityHandshaker* h = static_cast(arg); - grpc_core::ExecCtx::Run( + ExecCtx::Run( DEBUG_LOCATION, GRPC_CLOSURE_INIT(&h->on_handshake_data_received_from_peer_, &SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn, @@ -473,7 +473,7 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn( void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler( void* arg, grpc_error_handle error) { SecurityHandshaker* h = static_cast(arg); - grpc_core::ExecCtx::Run( + ExecCtx::Run( DEBUG_LOCATION, GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer_, &SecurityHandshaker::OnHandshakeDataSentToPeerFn, h, diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc index 8f15a066221..44af1f4f748 100644 --- a/src/core/lib/slice/slice.cc +++ b/src/core/lib/slice/slice.cc @@ -139,7 +139,7 @@ class NewWithLenSliceRefcount { /** grpc_slice_from_moved_(string|buffer) ref count .*/ class MovedStringSliceRefCount { public: - explicit MovedStringSliceRefCount(grpc_core::UniquePtr&& str) + explicit MovedStringSliceRefCount(UniquePtr&& str) : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this, &base_), str_(std::move(str)) {} @@ -152,8 +152,8 @@ class MovedStringSliceRefCount { } grpc_slice_refcount base_; - grpc_core::RefCount refs_; - grpc_core::UniquePtr str_; + RefCount refs_; + UniquePtr str_; }; // grpc_slice_from_cpp_string() ref count. @@ -172,7 +172,7 @@ class MovedCppStringSliceRefCount { } grpc_slice_refcount base_; - grpc_core::RefCount refs_; + RefCount refs_; std::string str_; }; diff --git a/src/core/lib/slice/static_slice.cc b/src/core/lib/slice/static_slice.cc index 40681b11348..76bc08ed7bb 100644 --- a/src/core/lib/slice/static_slice.cc +++ b/src/core/lib/slice/static_slice.cc @@ -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, 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] = { @@ -195,335 +195,225 @@ StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] = const StaticMetadataSlice g_static_metadata_slice_table[GRPC_STATIC_MDSTR_COUNT] = { - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[0].base, 5, - g_static_metadata_bytes + 0), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[1].base, 7, - g_static_metadata_bytes + 5), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[3].base, 10, - g_static_metadata_bytes + 19), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[4].base, 7, - g_static_metadata_bytes + 29), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[5].base, 12, - g_static_metadata_bytes + 36), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[6].base, 11, - g_static_metadata_bytes + 48), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[7].base, 16, - g_static_metadata_bytes + 59), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[8].base, 13, - g_static_metadata_bytes + 75), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[10].base, 21, - g_static_metadata_bytes + 108), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[11].base, 13, - g_static_metadata_bytes + 129), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[12].base, 14, - g_static_metadata_bytes + 142), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[13].base, 12, - g_static_metadata_bytes + 156), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[14].base, 16, - g_static_metadata_bytes + 168), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[16].base, 30, - g_static_metadata_bytes + 199), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[17].base, 37, - g_static_metadata_bytes + 229), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[18].base, 10, - g_static_metadata_bytes + 266), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[19].base, 4, - g_static_metadata_bytes + 276), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[20].base, 26, - g_static_metadata_bytes + 280), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[21].base, 22, - g_static_metadata_bytes + 306), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[22].base, 27, - g_static_metadata_bytes + 328), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[23].base, 12, - g_static_metadata_bytes + 355), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[24].base, 1, - g_static_metadata_bytes + 367), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[25].base, 1, - g_static_metadata_bytes + 368), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[26].base, 1, - g_static_metadata_bytes + 369), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[27].base, 1, - g_static_metadata_bytes + 370), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[29].base, 19, - g_static_metadata_bytes + 371), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[30].base, 12, - g_static_metadata_bytes + 390), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[31].base, 30, - g_static_metadata_bytes + 402), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[32].base, 31, - g_static_metadata_bytes + 432), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[33].base, 36, - g_static_metadata_bytes + 463), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[34].base, 65, - g_static_metadata_bytes + 499), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[35].base, 65, - g_static_metadata_bytes + 564), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[36].base, 28, - g_static_metadata_bytes + 629), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[37].base, 80, - g_static_metadata_bytes + 657), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[38].base, 80, - g_static_metadata_bytes + 737), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[39].base, 7, - g_static_metadata_bytes + 817), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[40].base, 4, - g_static_metadata_bytes + 824), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[41].base, 11, - g_static_metadata_bytes + 828), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[42].base, 2, - g_static_metadata_bytes + 839), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[43].base, 8, - g_static_metadata_bytes + 841), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[44].base, 3, - g_static_metadata_bytes + 849), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[45].base, 4, - g_static_metadata_bytes + 852), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[46].base, 1, - g_static_metadata_bytes + 856), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[47].base, 11, - g_static_metadata_bytes + 857), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[48].base, 4, - g_static_metadata_bytes + 868), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[49].base, 5, - g_static_metadata_bytes + 872), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[50].base, 3, - g_static_metadata_bytes + 877), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[51].base, 3, - g_static_metadata_bytes + 880), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[52].base, 3, - g_static_metadata_bytes + 883), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[53].base, 3, - g_static_metadata_bytes + 886), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[54].base, 3, - g_static_metadata_bytes + 889), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[55].base, 3, - g_static_metadata_bytes + 892), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[56].base, 3, - g_static_metadata_bytes + 895), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[57].base, 14, - g_static_metadata_bytes + 898), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[58].base, 13, - g_static_metadata_bytes + 912), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[59].base, 15, - g_static_metadata_bytes + 925), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[60].base, 13, - g_static_metadata_bytes + 940), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[61].base, 6, - g_static_metadata_bytes + 953), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[62].base, 27, - g_static_metadata_bytes + 959), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[63].base, 3, - g_static_metadata_bytes + 986), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[64].base, 5, - g_static_metadata_bytes + 989), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[65].base, 13, - g_static_metadata_bytes + 994), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[66].base, 13, - g_static_metadata_bytes + 1007), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[67].base, 19, - g_static_metadata_bytes + 1020), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[68].base, 16, - g_static_metadata_bytes + 1039), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[69].base, 14, - g_static_metadata_bytes + 1055), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[70].base, 16, - g_static_metadata_bytes + 1069), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[71].base, 13, - g_static_metadata_bytes + 1085), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[72].base, 6, - g_static_metadata_bytes + 1098), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[73].base, 4, - g_static_metadata_bytes + 1104), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[74].base, 4, - g_static_metadata_bytes + 1108), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[75].base, 6, - g_static_metadata_bytes + 1112), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[76].base, 7, - g_static_metadata_bytes + 1118), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[77].base, 4, - g_static_metadata_bytes + 1125), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[78].base, 8, - g_static_metadata_bytes + 1129), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[79].base, 17, - g_static_metadata_bytes + 1137), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[80].base, 13, - g_static_metadata_bytes + 1154), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[81].base, 8, - g_static_metadata_bytes + 1167), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[82].base, 19, - g_static_metadata_bytes + 1175), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[83].base, 13, - g_static_metadata_bytes + 1194), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[84].base, 4, - g_static_metadata_bytes + 1207), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[85].base, 8, - g_static_metadata_bytes + 1211), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[86].base, 12, - g_static_metadata_bytes + 1219), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[87].base, 18, - g_static_metadata_bytes + 1231), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[88].base, 19, - g_static_metadata_bytes + 1249), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[89].base, 5, - g_static_metadata_bytes + 1268), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[90].base, 7, - g_static_metadata_bytes + 1273), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[91].base, 7, - g_static_metadata_bytes + 1280), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[92].base, 11, - g_static_metadata_bytes + 1287), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[93].base, 6, - g_static_metadata_bytes + 1298), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[94].base, 10, - g_static_metadata_bytes + 1304), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[95].base, 25, - g_static_metadata_bytes + 1314), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[96].base, 17, - g_static_metadata_bytes + 1339), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[97].base, 4, - g_static_metadata_bytes + 1356), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[98].base, 3, - g_static_metadata_bytes + 1360), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[99].base, 16, - g_static_metadata_bytes + 1363), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[100].base, 1, - g_static_metadata_bytes + 1379), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[101].base, 8, - g_static_metadata_bytes + 1380), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[102].base, 16, - g_static_metadata_bytes + 1388), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[103].base, 4, - g_static_metadata_bytes + 1404), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[104].base, 3, - g_static_metadata_bytes + 1408), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[105].base, 11, - g_static_metadata_bytes + 1411), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[106].base, 16, - g_static_metadata_bytes + 1422), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[107].base, 13, - g_static_metadata_bytes + 1438), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[108].base, 12, - g_static_metadata_bytes + 1451), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[109].base, 21, - g_static_metadata_bytes + 1463), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5, + g_static_metadata_bytes + 0), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7, + g_static_metadata_bytes + 5), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10, + g_static_metadata_bytes + 19), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7, + g_static_metadata_bytes + 29), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 12, + g_static_metadata_bytes + 36), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11, + g_static_metadata_bytes + 48), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 16, + g_static_metadata_bytes + 59), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13, + g_static_metadata_bytes + 75), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 21, + g_static_metadata_bytes + 108), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[11].base, 13, + g_static_metadata_bytes + 129), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[12].base, 14, + g_static_metadata_bytes + 142), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12, + g_static_metadata_bytes + 156), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16, + g_static_metadata_bytes + 168), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 30, + g_static_metadata_bytes + 199), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 37, + g_static_metadata_bytes + 229), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 10, + g_static_metadata_bytes + 266), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 4, + g_static_metadata_bytes + 276), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[20].base, 26, + g_static_metadata_bytes + 280), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[21].base, 22, + g_static_metadata_bytes + 306), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 27, + g_static_metadata_bytes + 328), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 12, + g_static_metadata_bytes + 355), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1, + g_static_metadata_bytes + 367), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 1, + g_static_metadata_bytes + 368), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 1, + g_static_metadata_bytes + 369), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 1, + g_static_metadata_bytes + 370), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[29].base, 19, + g_static_metadata_bytes + 371), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[30].base, 12, + g_static_metadata_bytes + 390), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 30, + g_static_metadata_bytes + 402), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 31, + g_static_metadata_bytes + 432), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 36, + g_static_metadata_bytes + 463), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 65, + g_static_metadata_bytes + 499), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 65, + g_static_metadata_bytes + 564), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 28, + g_static_metadata_bytes + 629), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 80, + g_static_metadata_bytes + 657), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 80, + g_static_metadata_bytes + 737), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7, + g_static_metadata_bytes + 817), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4, + g_static_metadata_bytes + 824), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 11, + g_static_metadata_bytes + 828), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 2, + g_static_metadata_bytes + 839), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 8, + g_static_metadata_bytes + 841), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 3, + g_static_metadata_bytes + 849), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 4, + g_static_metadata_bytes + 852), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 1, + g_static_metadata_bytes + 856), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 11, + g_static_metadata_bytes + 857), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 4, + g_static_metadata_bytes + 868), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 5, + g_static_metadata_bytes + 872), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3, + g_static_metadata_bytes + 877), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3, + g_static_metadata_bytes + 880), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 3, + g_static_metadata_bytes + 883), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 3, + g_static_metadata_bytes + 886), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 3, + g_static_metadata_bytes + 889), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 3, + g_static_metadata_bytes + 892), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 3, + g_static_metadata_bytes + 895), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 14, + g_static_metadata_bytes + 898), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13, + g_static_metadata_bytes + 912), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 15, + g_static_metadata_bytes + 925), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13, + g_static_metadata_bytes + 940), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 6, + g_static_metadata_bytes + 953), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 27, + g_static_metadata_bytes + 959), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 3, + g_static_metadata_bytes + 986), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 5, + g_static_metadata_bytes + 989), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 13, + g_static_metadata_bytes + 994), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13, + g_static_metadata_bytes + 1007), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 19, + g_static_metadata_bytes + 1020), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 16, + g_static_metadata_bytes + 1039), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 14, + g_static_metadata_bytes + 1055), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 16, + g_static_metadata_bytes + 1069), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13, + g_static_metadata_bytes + 1085), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 6, + g_static_metadata_bytes + 1098), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 4, + g_static_metadata_bytes + 1104), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 4, + g_static_metadata_bytes + 1108), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 6, + g_static_metadata_bytes + 1112), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 7, + g_static_metadata_bytes + 1118), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 4, + g_static_metadata_bytes + 1125), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 8, + g_static_metadata_bytes + 1129), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 17, + g_static_metadata_bytes + 1137), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 13, + g_static_metadata_bytes + 1154), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 8, + g_static_metadata_bytes + 1167), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 19, + g_static_metadata_bytes + 1175), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 13, + g_static_metadata_bytes + 1194), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 4, + g_static_metadata_bytes + 1207), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 8, + g_static_metadata_bytes + 1211), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 12, + g_static_metadata_bytes + 1219), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 18, + g_static_metadata_bytes + 1231), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 19, + g_static_metadata_bytes + 1249), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 5, + g_static_metadata_bytes + 1268), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 7, + g_static_metadata_bytes + 1273), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 7, + g_static_metadata_bytes + 1280), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 11, + g_static_metadata_bytes + 1287), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 6, + g_static_metadata_bytes + 1298), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 10, + g_static_metadata_bytes + 1304), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 25, + g_static_metadata_bytes + 1314), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 17, + g_static_metadata_bytes + 1339), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 4, + g_static_metadata_bytes + 1356), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 3, + g_static_metadata_bytes + 1360), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 16, + g_static_metadata_bytes + 1363), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 1, + g_static_metadata_bytes + 1379), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8, + g_static_metadata_bytes + 1380), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 16, + g_static_metadata_bytes + 1388), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 4, + g_static_metadata_bytes + 1404), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 3, + g_static_metadata_bytes + 1408), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[105].base, 11, + g_static_metadata_bytes + 1411), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[106].base, 16, + g_static_metadata_bytes + 1422), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13, + g_static_metadata_bytes + 1438), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[108].base, 12, + g_static_metadata_bytes + 1451), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[109].base, 21, + g_static_metadata_bytes + 1463), }; } // namespace grpc_core diff --git a/src/core/lib/surface/builtins.cc b/src/core/lib/surface/builtins.cc index b195ef9b3cf..dbd9cd1f3fe 100644 --- a/src/core/lib/surface/builtins.cc +++ b/src/core/lib/surface/builtins.cc @@ -42,7 +42,7 @@ void RegisterBuiltins(CoreConfiguration::Builder* builder) { builder->channel_init()->RegisterStage( GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) { return grpc_channel_stack_builder_prepend_filter( - builder, &grpc_core::Server::kServerTopFilter, nullptr, nullptr); + builder, &Server::kServerTopFilter, nullptr, nullptr); }); } diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index f047ce5ba93..9037d2e1a7a 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -85,7 +85,7 @@ struct RegisteredCall { }; struct CallRegistrationTable { - grpc_core::Mutex mu; + Mutex mu; // 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 // C++ or other wrapped language Channel that registered these calls). diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc index f54dc72e38b..198f87071ec 100644 --- a/src/core/lib/surface/lame_client.cc +++ b/src/core/lib/surface/lame_client.cc @@ -141,7 +141,7 @@ void ErrorDestroy(void* p) { 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 = { ErrorCopy, ErrorDestroy, ErrorCompare}; diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 834a3b2a49f..29cee371768 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -601,7 +601,7 @@ void Server::Start() { grpc_error_handle Server::SetupTransport( grpc_transport* transport, grpc_pollset* accepting_pollset, const grpc_channel_args* args, - const RefCountedPtr& socket_node) { + const RefCountedPtr& socket_node) { // Create channel. grpc_error_handle error = GRPC_ERROR_NONE; grpc_channel* channel = grpc_channel_create( diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index 853eca69b69..6af45afc01a 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -81,7 +81,7 @@ grpc_millis BdpEstimator::CompletePing() { } ping_state_ = PingState::UNSCHEDULED; accumulator_ = 0; - return grpc_core::ExecCtx::Get()->Now() + inter_ping_delay_; + return ExecCtx::Get()->Now() + inter_ping_delay_; } } // namespace grpc_core diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 43e1827f4df..88128192481 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -313,10 +313,10 @@ class AllocatedMetadata : public RefcountedMdBase { // TODO(arjunroy): Change to use strongly typed slices instead. struct NoRefKey {}; AllocatedMetadata(const grpc_slice& key, const grpc_slice& value); - AllocatedMetadata(const grpc_core::ManagedMemorySlice& key, - const grpc_core::UnmanagedMemorySlice& value); - AllocatedMetadata(const grpc_core::ExternallyManagedSlice& key, - const grpc_core::UnmanagedMemorySlice& value); + AllocatedMetadata(const ManagedMemorySlice& key, + const UnmanagedMemorySlice& value); + AllocatedMetadata(const ExternallyManagedSlice& key, + const UnmanagedMemorySlice& value); AllocatedMetadata(const grpc_slice& key, const grpc_slice& value, const NoRefKey*); ~AllocatedMetadata(); diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h index fbd9abc77bc..2a90e823ed1 100644 --- a/src/core/lib/transport/metadata_batch.h +++ b/src/core/lib/transport/metadata_batch.h @@ -95,7 +95,7 @@ struct GrpcTimeoutMetadata { if (timeout == 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) { char timeout[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; @@ -820,9 +820,8 @@ absl::optional MetadataMap::GetValue( // Find all values for the specified key. absl::InlinedVector values; 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 value = - grpc_core::StringViewFromSlice(GRPC_MDVALUE(md->md)); + absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md)); + absl::string_view value = StringViewFromSlice(GRPC_MDVALUE(md->md)); if (target_key == key) values.push_back(value); } // If none found, no match. diff --git a/src/core/lib/transport/pid_controller.cc b/src/core/lib/transport/pid_controller.cc index c187a2be591..c0dc38ad6ad 100644 --- a/src/core/lib/transport/pid_controller.cc +++ b/src/core/lib/transport/pid_controller.cc @@ -31,8 +31,8 @@ double PidController::Update(double error, double dt) { if (dt <= 0) return last_control_value_; /* integrate error using the trapezoid rule */ error_integral_ += dt * (last_error_ + error) * 0.5; - error_integral_ = grpc_core::Clamp(error_integral_, -args_.integral_range(), - args_.integral_range()); + error_integral_ = + Clamp(error_integral_, -args_.integral_range(), args_.integral_range()); double diff_error = (error - last_error_) / dt; /* calculate derivative of control value vs time */ 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 */ double new_control_value = last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5; - new_control_value = grpc_core::Clamp( - new_control_value, args_.min_control_value(), args_.max_control_value()); + new_control_value = Clamp(new_control_value, args_.min_control_value(), + args_.max_control_value()); last_error_ = error; last_dc_dt_ = dc_dt; last_control_value_ = new_control_value; diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc index 71f4deef504..c6c745d9d2f 100644 --- a/src/core/lib/transport/static_metadata.cc +++ b/src/core/lib/transport/static_metadata.cc @@ -32,594 +32,510 @@ namespace grpc_core { StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[3].base, 10, - g_static_metadata_bytes + 19), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 0), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[1].base, 7, - g_static_metadata_bytes + 5), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[44].base, 3, - g_static_metadata_bytes + 849), - 1), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[1].base, 7, - g_static_metadata_bytes + 5), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[45].base, 4, - g_static_metadata_bytes + 852), - 2), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[0].base, 5, - g_static_metadata_bytes + 0), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[46].base, 1, - g_static_metadata_bytes + 856), - 3), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[0].base, 5, - g_static_metadata_bytes + 0), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[47].base, 11, - g_static_metadata_bytes + 857), - 4), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[4].base, 7, - g_static_metadata_bytes + 29), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[48].base, 4, - g_static_metadata_bytes + 868), - 5), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[4].base, 7, - g_static_metadata_bytes + 29), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[49].base, 5, - g_static_metadata_bytes + 872), - 6), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[50].base, 3, - g_static_metadata_bytes + 877), - 7), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[51].base, 3, - g_static_metadata_bytes + 880), - 8), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[52].base, 3, - g_static_metadata_bytes + 883), - 9), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[53].base, 3, - g_static_metadata_bytes + 886), - 10), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[54].base, 3, - g_static_metadata_bytes + 889), - 11), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[55].base, 3, - g_static_metadata_bytes + 892), - 12), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[2].base, 7, - g_static_metadata_bytes + 12), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[56].base, 3, - g_static_metadata_bytes + 895), - 13), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[57].base, 14, - g_static_metadata_bytes + 898), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 14), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[58].base, 13, - g_static_metadata_bytes + 912), - 15), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[59].base, 15, - g_static_metadata_bytes + 925), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 16), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[60].base, 13, - g_static_metadata_bytes + 940), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 17), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[61].base, 6, - g_static_metadata_bytes + 953), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 18), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[62].base, 27, - g_static_metadata_bytes + 959), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 19), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[63].base, 3, - g_static_metadata_bytes + 986), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 20), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[64].base, 5, - g_static_metadata_bytes + 989), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 21), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[65].base, 13, - g_static_metadata_bytes + 994), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 22), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[66].base, 13, - g_static_metadata_bytes + 1007), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 23), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[67].base, 19, - g_static_metadata_bytes + 1020), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 24), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[14].base, 16, - g_static_metadata_bytes + 168), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 25), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[68].base, 16, - g_static_metadata_bytes + 1039), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 26), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[69].base, 14, - g_static_metadata_bytes + 1055), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 27), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[70].base, 16, - g_static_metadata_bytes + 1069), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 28), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[71].base, 13, - g_static_metadata_bytes + 1085), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 29), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[13].base, 12, - g_static_metadata_bytes + 156), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 30), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[72].base, 6, - g_static_metadata_bytes + 1098), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 31), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[73].base, 4, - g_static_metadata_bytes + 1104), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 32), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[74].base, 4, - g_static_metadata_bytes + 1108), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 33), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[75].base, 6, - g_static_metadata_bytes + 1112), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 34), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[76].base, 7, - g_static_metadata_bytes + 1118), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 35), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[77].base, 4, - g_static_metadata_bytes + 1125), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 36), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[19].base, 4, - g_static_metadata_bytes + 276), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 37), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[78].base, 8, - g_static_metadata_bytes + 1129), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 38), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[79].base, 17, - g_static_metadata_bytes + 1137), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 39), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[80].base, 13, - g_static_metadata_bytes + 1154), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 40), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[81].base, 8, - g_static_metadata_bytes + 1167), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 41), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[82].base, 19, - g_static_metadata_bytes + 1175), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 42), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[83].base, 13, - g_static_metadata_bytes + 1194), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 43), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[84].base, 4, - g_static_metadata_bytes + 1207), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 44), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[85].base, 8, - g_static_metadata_bytes + 1211), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 45), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[86].base, 12, - g_static_metadata_bytes + 1219), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 46), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[87].base, 18, - g_static_metadata_bytes + 1231), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 47), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[88].base, 19, - g_static_metadata_bytes + 1249), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 48), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[89].base, 5, - g_static_metadata_bytes + 1268), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 49), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[90].base, 7, - g_static_metadata_bytes + 1273), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 50), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[91].base, 7, - g_static_metadata_bytes + 1280), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 51), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[92].base, 11, - g_static_metadata_bytes + 1287), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 52), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[93].base, 6, - g_static_metadata_bytes + 1298), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 53), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[94].base, 10, - g_static_metadata_bytes + 1304), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 54), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[95].base, 25, - g_static_metadata_bytes + 1314), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 55), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[96].base, 17, - g_static_metadata_bytes + 1339), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 56), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[18].base, 10, - g_static_metadata_bytes + 266), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 57), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[97].base, 4, - g_static_metadata_bytes + 1356), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 58), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[98].base, 3, - g_static_metadata_bytes + 1360), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 59), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[99].base, 16, - g_static_metadata_bytes + 1363), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 60), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[6].base, 11, - g_static_metadata_bytes + 48), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[100].base, 1, - g_static_metadata_bytes + 1379), - 61), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[6].base, 11, - g_static_metadata_bytes + 48), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[24].base, 1, - g_static_metadata_bytes + 367), - 62), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[6].base, 11, - g_static_metadata_bytes + 48), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[25].base, 1, - g_static_metadata_bytes + 368), - 63), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[8].base, 13, - g_static_metadata_bytes + 75), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[101].base, 8, - g_static_metadata_bytes + 1380), - 64), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[8].base, 13, - g_static_metadata_bytes + 75), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[40].base, 4, - g_static_metadata_bytes + 824), - 65), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[8].base, 13, - g_static_metadata_bytes + 75), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[39].base, 7, - g_static_metadata_bytes + 817), - 66), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[13].base, 12, - g_static_metadata_bytes + 156), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[102].base, 16, - g_static_metadata_bytes + 1388), - 67), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[4].base, 7, - g_static_metadata_bytes + 29), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[103].base, 4, - g_static_metadata_bytes + 1404), - 68), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[1].base, 7, - g_static_metadata_bytes + 5), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[104].base, 3, - g_static_metadata_bytes + 1408), - 69), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 70), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[14].base, 16, - g_static_metadata_bytes + 168), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[101].base, 8, - g_static_metadata_bytes + 1380), - 71), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[14].base, 16, - g_static_metadata_bytes + 168), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[40].base, 4, - g_static_metadata_bytes + 824), - 72), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[105].base, 11, - g_static_metadata_bytes + 1411), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[28].base, 0, - g_static_metadata_bytes + 371), - 73), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[101].base, 8, - g_static_metadata_bytes + 1380), - 74), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[39].base, 7, - g_static_metadata_bytes + 817), - 75), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[106].base, 16, - g_static_metadata_bytes + 1422), - 76), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[40].base, 4, - g_static_metadata_bytes + 824), - 77), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[107].base, 13, - g_static_metadata_bytes + 1438), - 78), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[108].base, 12, - g_static_metadata_bytes + 1451), - 79), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[9].base, 20, - g_static_metadata_bytes + 88), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[109].base, 21, - g_static_metadata_bytes + 1463), - 80), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[101].base, 8, - g_static_metadata_bytes + 1380), - 81), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[40].base, 4, - g_static_metadata_bytes + 824), - 82), - StaticMetadata(grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[15].base, 15, - g_static_metadata_bytes + 184), - grpc_core::StaticMetadataSlice( - &g_static_metadata_slice_refcounts[107].base, 13, - g_static_metadata_bytes + 1438), - 83), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10, + g_static_metadata_bytes + 19), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 0), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7, + g_static_metadata_bytes + 5), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 3, + g_static_metadata_bytes + 849), + 1), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7, + g_static_metadata_bytes + 5), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 4, + g_static_metadata_bytes + 852), + 2), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5, + g_static_metadata_bytes + 0), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 1, + g_static_metadata_bytes + 856), + 3), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5, + g_static_metadata_bytes + 0), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 11, + g_static_metadata_bytes + 857), + 4), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7, + g_static_metadata_bytes + 29), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 4, + g_static_metadata_bytes + 868), + 5), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7, + g_static_metadata_bytes + 29), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 5, + g_static_metadata_bytes + 872), + 6), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3, + g_static_metadata_bytes + 877), + 7), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3, + g_static_metadata_bytes + 880), + 8), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 3, + g_static_metadata_bytes + 883), + 9), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 3, + g_static_metadata_bytes + 886), + 10), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 3, + g_static_metadata_bytes + 889), + 11), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 3, + g_static_metadata_bytes + 892), + 12), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7, + g_static_metadata_bytes + 12), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 3, + g_static_metadata_bytes + 895), + 13), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 14, + g_static_metadata_bytes + 898), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 14), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13, + g_static_metadata_bytes + 912), + 15), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 15, + g_static_metadata_bytes + 925), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 16), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13, + g_static_metadata_bytes + 940), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 17), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 6, + g_static_metadata_bytes + 953), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 18), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 27, + g_static_metadata_bytes + 959), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 19), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 3, + g_static_metadata_bytes + 986), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 20), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 5, + g_static_metadata_bytes + 989), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 21), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 13, + g_static_metadata_bytes + 994), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 22), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13, + g_static_metadata_bytes + 1007), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 23), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 19, + g_static_metadata_bytes + 1020), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 24), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16, + g_static_metadata_bytes + 168), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 25), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 16, + g_static_metadata_bytes + 1039), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 26), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 14, + g_static_metadata_bytes + 1055), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 27), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 16, + g_static_metadata_bytes + 1069), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 28), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13, + g_static_metadata_bytes + 1085), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 29), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12, + g_static_metadata_bytes + 156), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 30), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 6, + g_static_metadata_bytes + 1098), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 31), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 4, + g_static_metadata_bytes + 1104), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 32), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 4, + g_static_metadata_bytes + 1108), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 33), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 6, + g_static_metadata_bytes + 1112), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 34), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 7, + g_static_metadata_bytes + 1118), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 35), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 4, + g_static_metadata_bytes + 1125), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 36), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 4, + g_static_metadata_bytes + 276), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 37), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 8, + g_static_metadata_bytes + 1129), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 38), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 17, + g_static_metadata_bytes + 1137), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 39), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 13, + g_static_metadata_bytes + 1154), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 40), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 8, + g_static_metadata_bytes + 1167), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 41), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 19, + g_static_metadata_bytes + 1175), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 42), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 13, + g_static_metadata_bytes + 1194), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 43), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 4, + g_static_metadata_bytes + 1207), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 44), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 8, + g_static_metadata_bytes + 1211), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 45), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 12, + g_static_metadata_bytes + 1219), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 46), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 18, + g_static_metadata_bytes + 1231), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 47), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 19, + g_static_metadata_bytes + 1249), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 48), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 5, + g_static_metadata_bytes + 1268), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 49), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 7, + g_static_metadata_bytes + 1273), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 50), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 7, + g_static_metadata_bytes + 1280), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 51), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 11, + g_static_metadata_bytes + 1287), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 52), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 6, + g_static_metadata_bytes + 1298), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 53), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 10, + g_static_metadata_bytes + 1304), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 54), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 25, + g_static_metadata_bytes + 1314), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 55), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 17, + g_static_metadata_bytes + 1339), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 56), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 10, + g_static_metadata_bytes + 266), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 57), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 4, + g_static_metadata_bytes + 1356), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 58), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 3, + g_static_metadata_bytes + 1360), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 59), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 16, + g_static_metadata_bytes + 1363), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 60), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11, + g_static_metadata_bytes + 48), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 1, + g_static_metadata_bytes + 1379), + 61), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11, + g_static_metadata_bytes + 48), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1, + g_static_metadata_bytes + 367), + 62), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11, + g_static_metadata_bytes + 48), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 1, + g_static_metadata_bytes + 368), + 63), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13, + g_static_metadata_bytes + 75), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8, + g_static_metadata_bytes + 1380), + 64), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13, + g_static_metadata_bytes + 75), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4, + g_static_metadata_bytes + 824), + 65), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13, + g_static_metadata_bytes + 75), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7, + g_static_metadata_bytes + 817), + 66), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12, + g_static_metadata_bytes + 156), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 16, + g_static_metadata_bytes + 1388), + 67), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7, + g_static_metadata_bytes + 29), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 4, + g_static_metadata_bytes + 1404), + 68), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7, + g_static_metadata_bytes + 5), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 3, + g_static_metadata_bytes + 1408), + 69), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 70), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16, + g_static_metadata_bytes + 168), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8, + g_static_metadata_bytes + 1380), + 71), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16, + g_static_metadata_bytes + 168), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4, + g_static_metadata_bytes + 824), + 72), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[105].base, 11, + g_static_metadata_bytes + 1411), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 0, + g_static_metadata_bytes + 371), + 73), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8, + g_static_metadata_bytes + 1380), + 74), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 7, + g_static_metadata_bytes + 817), + 75), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[106].base, 16, + g_static_metadata_bytes + 1422), + 76), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4, + g_static_metadata_bytes + 824), + 77), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13, + g_static_metadata_bytes + 1438), + 78), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[108].base, 12, + g_static_metadata_bytes + 1451), + 79), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20, + g_static_metadata_bytes + 88), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[109].base, 21, + g_static_metadata_bytes + 1463), + 80), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 8, + g_static_metadata_bytes + 1380), + 81), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4, + g_static_metadata_bytes + 824), + 82), + StaticMetadata( + StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15, + g_static_metadata_bytes + 184), + StaticMetadataSlice(&g_static_metadata_slice_refcounts[107].base, 13, + g_static_metadata_bytes + 1438), + 83), }; /* Warning: the core static metadata currently operates under the soft diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc index 87fd18edc3e..b82d76fbff6 100644 --- a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +++ b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc @@ -849,7 +849,7 @@ void alts_handshaker_client_on_status_received_for_testing( reinterpret_cast(c); client->handshake_status_code = status; 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 diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channel/channel_trace_test.cc index 824bd21e6ab..254e8f5c85e 100644 --- a/test/core/channel/channel_trace_test.cc +++ b/test/core/channel/channel_trace_test.cc @@ -123,7 +123,7 @@ const int kEventListMemoryLimit = 1024 * 1024; // Tests basic ChannelTrace functionality like construction, adding trace, and // lookups by uuid. TEST(ChannelTracerTest, BasicTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelTrace tracer(kEventListMemoryLimit); AddSimpleTrace(&tracer); AddSimpleTrace(&tracer); @@ -146,7 +146,7 @@ TEST(ChannelTracerTest, BasicTest) { // subchannles. This exercises the ref/unref patterns since the parent tracer // and this function will both hold refs to the subchannel. TEST(ChannelTracerTest, ComplexTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelTrace tracer(kEventListMemoryLimit); AddSimpleTrace(&tracer); AddSimpleTrace(&tracer); @@ -193,7 +193,7 @@ TEST(ChannelTracerTest, ComplexTest) { // have connections. Ensures that everything lives as long as it should then // gets deleted. TEST(ChannelTracerTest, TestNesting) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelTrace tracer(kEventListMemoryLimit); AddSimpleTrace(&tracer); AddSimpleTrace(&tracer); @@ -240,7 +240,7 @@ TEST(ChannelTracerTest, TestNesting) { } TEST(ChannelTracerTest, TestSmallMemoryLimit) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // doesn't make sense, but serves a testing purpose for the channel tracing // bookkeeping. All tracing events added should will get immediately garbage // collected. @@ -264,7 +264,7 @@ TEST(ChannelTracerTest, TestSmallMemoryLimit) { } TEST(ChannelTracerTest, TestEviction) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; const int kTraceEventSize = GetSizeofTraceEvent(); const int kNumEvents = 5; ChannelTrace tracer(kTraceEventSize * kNumEvents); @@ -281,7 +281,7 @@ TEST(ChannelTracerTest, TestEviction) { } TEST(ChannelTracerTest, TestMultipleEviction) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; const int kTraceEventSize = GetSizeofTraceEvent(); const int kNumEvents = 5; ChannelTrace tracer(kTraceEventSize * kNumEvents); @@ -300,7 +300,7 @@ TEST(ChannelTracerTest, TestMultipleEviction) { } TEST(ChannelTracerTest, TestTotalEviction) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; const int kTraceEventSize = GetSizeofTraceEvent(); const int kNumEvents = 5; ChannelTrace tracer(kTraceEventSize * kNumEvents); diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc index bd59ea4097e..98710e474e2 100644 --- a/test/core/channel/channelz_test.cc +++ b/test/core/channel/channelz_test.cc @@ -248,7 +248,7 @@ gpr_timespec GetLastCallStartedTime(CallCountingHelper* channel) { void ChannelzSleep(int64_t sleep_us) { gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(sleep_us, GPR_TIMESPAN))); - grpc_core::ExecCtx::Get()->InvalidateNow(); + ExecCtx::Get()->InvalidateNow(); } } // anonymous namespace @@ -256,7 +256,7 @@ void ChannelzSleep(int64_t sleep_us) { class ChannelzChannelTest : public ::testing::TestWithParam {}; TEST_P(ChannelzChannelTest, BasicChannel) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channel(GetParam()); ChannelNode* channelz_channel = grpc_channel_get_channelz_node(channel.channel()); @@ -264,7 +264,7 @@ TEST_P(ChannelzChannelTest, BasicChannel) { } TEST(ChannelzChannelTest, ChannelzDisabled) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // explicitly disable channelz grpc_arg arg[] = { grpc_channel_arg_integer_create( @@ -281,7 +281,7 @@ TEST(ChannelzChannelTest, ChannelzDisabled) { } TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channel(GetParam()); ChannelNode* channelz_channel = grpc_channel_get_channelz_node(channel.channel()); @@ -299,7 +299,7 @@ TEST_P(ChannelzChannelTest, BasicChannelAPIFunctionality) { } TEST_P(ChannelzChannelTest, LastCallStartedTime) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; CallCountingHelper counter; // start a call to set the last call started timestamp counter.RecordCallStarted(); @@ -337,25 +337,25 @@ class ChannelzRegistryBasedTest : public ::testing::TestWithParam { }; TEST_F(ChannelzRegistryBasedTest, BasicGetTopChannelsTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channel; ValidateGetTopChannels(1); } TEST_F(ChannelzRegistryBasedTest, NoChannelsTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ValidateGetTopChannels(0); } TEST_F(ChannelzRegistryBasedTest, ManyChannelsTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channels[10]; (void)channels; // suppress unused variable error ValidateGetTopChannels(10); } TEST_F(ChannelzRegistryBasedTest, GetTopChannelsPagination) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // This is over the pagination limit. ChannelFixture channels[150]; (void)channels; // suppress unused variable error @@ -383,7 +383,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsPagination) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidCheck) { const intptr_t kNumChannels = 50; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channels[kNumChannels]; (void)channels; // suppress unused variable error std::string json_str = ChannelzRegistry::GetTopChannels(0); @@ -402,7 +402,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidCheck) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMiddleUuidCheck) { const intptr_t kNumChannels = 50; const intptr_t kMidQuery = 40; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channels[kNumChannels]; (void)channels; // suppress unused variable error // Only query for the end of the channels. @@ -420,7 +420,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMiddleUuidCheck) { } TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture pre_channels[40]; // will take uuid[1, 40] (void)pre_channels; // suppress unused variable error ServerFixture servers[10]; // will take uuid[41, 50] @@ -442,7 +442,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsNoHitUuid) { } TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channel_with_uuid1; { ServerFixture channel_with_uuid2; } ChannelFixture channel_with_uuid3; @@ -472,7 +472,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsMoreGaps) { TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) { const intptr_t kLoopIterations = 50; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; std::vector> even_channels; { // these will delete and unregister themselves after this block. @@ -497,7 +497,7 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) { } TEST_F(ChannelzRegistryBasedTest, InternalChannelTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ChannelFixture channels[10]; (void)channels; // suppress unused variable error // create an internal channel @@ -516,7 +516,7 @@ TEST_F(ChannelzRegistryBasedTest, InternalChannelTest) { } TEST(ChannelzServerTest, BasicServerAPIFunctionality) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ServerFixture server(10); ServerNode* channelz_server = server.server()->core_server->channelz_node(); channelz_server->RecordCallStarted(); @@ -533,18 +533,18 @@ TEST(ChannelzServerTest, BasicServerAPIFunctionality) { } TEST_F(ChannelzRegistryBasedTest, BasicGetServersTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ServerFixture server; ValidateGetServers(1); } TEST_F(ChannelzRegistryBasedTest, NoServersTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ValidateGetServers(0); } TEST_F(ChannelzRegistryBasedTest, ManyServersTest) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; ServerFixture servers[10]; (void)servers; // suppress unused variable error ValidateGetServers(10); diff --git a/test/core/client_channel/service_config_test.cc b/test/core/client_channel/service_config_test.cc index b555fc47016..c916dcb381f 100644 --- a/test/core/client_channel/service_config_test.cc +++ b/test/core/client_channel/service_config_test.cc @@ -491,7 +491,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigPickFirst) { auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); auto lb_config = parsed_config->parsed_lb_config(); EXPECT_STREQ(lb_config->name(), "pick_first"); @@ -503,9 +503,8 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigRoundRobin) { grpc_error_handle error = GRPC_ERROR_NONE; auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); - auto parsed_config = - static_cast( - svc_cfg->GetGlobalParsedConfig(0)); + auto parsed_config = static_cast( + svc_cfg->GetGlobalParsedConfig(0)); auto lb_config = parsed_config->parsed_lb_config(); EXPECT_STREQ(lb_config->name(), "round_robin"); } @@ -518,7 +517,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigGrpclb) { auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); auto lb_config = parsed_config->parsed_lb_config(); EXPECT_STREQ(lb_config->name(), "grpclb"); @@ -541,7 +540,7 @@ TEST_F(ClientChannelParserTest, ValidLoadBalancingConfigXds) { auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); auto lb_config = parsed_config->parsed_lb_config(); 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); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); 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); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); EXPECT_EQ(parsed_config->parsed_deprecated_lb_policy(), "pick_first"); } @@ -648,10 +647,10 @@ TEST_F(ClientChannelParserTest, ValidTimeout) { grpc_slice_from_static_string("/TestServ/TestMethod")); ASSERT_NE(vector_ptr, nullptr); auto parsed_config = ((*vector_ptr)[0]).get(); - EXPECT_EQ((static_cast( - parsed_config)) - ->timeout(), - 5000); + EXPECT_EQ( + (static_cast(parsed_config)) + ->timeout(), + 5000); } TEST_F(ClientChannelParserTest, InvalidTimeout) { @@ -694,13 +693,11 @@ TEST_F(ClientChannelParserTest, ValidWaitForReady) { ASSERT_NE(vector_ptr, nullptr); auto parsed_config = ((*vector_ptr)[0]).get(); ASSERT_TRUE( - (static_cast( - parsed_config)) + (static_cast(parsed_config)) ->wait_for_ready() .has_value()); EXPECT_TRUE( - (static_cast( - parsed_config)) + (static_cast(parsed_config)) ->wait_for_ready() .value()); } @@ -737,7 +734,7 @@ TEST_F(ClientChannelParserTest, ValidHealthCheck) { auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); const auto* parsed_config = - static_cast( + static_cast( svc_cfg->GetGlobalParsedConfig(0)); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->health_check_service_name(), @@ -789,9 +786,8 @@ TEST_F(RetryParserTest, ValidRetryThrottling) { grpc_error_handle error = GRPC_ERROR_NONE; auto svc_cfg = ServiceConfig::Create(nullptr, test_json, &error); ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error); - const auto* parsed_config = - static_cast( - svc_cfg->GetGlobalParsedConfig(0)); + const auto* parsed_config = static_cast( + svc_cfg->GetGlobalParsedConfig(0)); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->max_milli_tokens(), 2000); EXPECT_EQ(parsed_config->milli_token_ratio(), 1000); @@ -878,8 +874,7 @@ TEST_F(RetryParserTest, ValidRetryPolicy) { grpc_slice_from_static_string("/TestServ/TestMethod")); ASSERT_NE(vector_ptr, nullptr); const auto* parsed_config = - static_cast( - ((*vector_ptr)[0]).get()); + static_cast(((*vector_ptr)[0]).get()); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->max_attempts(), 3); EXPECT_EQ(parsed_config->initial_backoff(), 1000); @@ -1264,8 +1259,7 @@ TEST_F(RetryParserTest, ValidRetryPolicyWithPerAttemptRecvTimeout) { grpc_slice_from_static_string("/TestServ/TestMethod")); ASSERT_NE(vector_ptr, nullptr); const auto* parsed_config = - static_cast( - ((*vector_ptr)[0]).get()); + static_cast(((*vector_ptr)[0]).get()); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->initial_backoff(), 1000); @@ -1301,8 +1295,7 @@ TEST_F(RetryParserTest, grpc_slice_from_static_string("/TestServ/TestMethod")); ASSERT_NE(vector_ptr, nullptr); const auto* parsed_config = - static_cast( - ((*vector_ptr)[0]).get()); + static_cast(((*vector_ptr)[0]).get()); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->initial_backoff(), 1000); @@ -1340,8 +1333,7 @@ TEST_F(RetryParserTest, grpc_slice_from_static_string("/TestServ/TestMethod")); ASSERT_NE(vector_ptr, nullptr); const auto* parsed_config = - static_cast( - ((*vector_ptr)[0]).get()); + static_cast(((*vector_ptr)[0]).get()); ASSERT_NE(parsed_config, nullptr); EXPECT_EQ(parsed_config->max_attempts(), 2); EXPECT_EQ(parsed_config->initial_backoff(), 1000); diff --git a/test/core/gpr/useful_test.cc b/test/core/gpr/useful_test.cc index 2d7d6705262..fb75d7aac81 100644 --- a/test/core/gpr/useful_test.cc +++ b/test/core/gpr/useful_test.cc @@ -25,16 +25,16 @@ namespace grpc_core { TEST(UsefulTest, ClampWorks) { - EXPECT_EQ(grpc_core::Clamp(1, 0, 2), 1); - EXPECT_EQ(grpc_core::Clamp(0, 0, 2), 0); - EXPECT_EQ(grpc_core::Clamp(2, 0, 2), 2); - EXPECT_EQ(grpc_core::Clamp(-1, 0, 2), 0); - EXPECT_EQ(grpc_core::Clamp(3, 0, 2), 2); + EXPECT_EQ(Clamp(1, 0, 2), 1); + EXPECT_EQ(Clamp(0, 0, 2), 0); + EXPECT_EQ(Clamp(2, 0, 2), 2); + EXPECT_EQ(Clamp(-1, 0, 2), 0); + EXPECT_EQ(Clamp(3, 0, 2), 2); } TEST(UsefulTest, Rotate) { - EXPECT_EQ(grpc_core::RotateLeft(0x80000001u, 1u), 3); - EXPECT_EQ(grpc_core::RotateRight(0x80000001u, 1u), 0xc0000000); + EXPECT_EQ(RotateLeft(0x80000001u, 1u), 3); + EXPECT_EQ(RotateRight(0x80000001u, 1u), 0xc0000000); } TEST(UsefulTest, ArraySize) { @@ -48,18 +48,18 @@ TEST(UsefulTest, ArraySize) { TEST(UsefulTest, BitOps) { uint32_t bitset = 0; - EXPECT_EQ(grpc_core::BitCount((1u << 31) - 1), 31); - EXPECT_EQ(grpc_core::BitCount(1u << 3), 1); - EXPECT_EQ(grpc_core::BitCount(0), 0); - EXPECT_EQ(grpc_core::SetBit(&bitset, 3), 8); - EXPECT_EQ(grpc_core::BitCount(bitset), 1); - EXPECT_EQ(grpc_core::GetBit(bitset, 3), 1); - EXPECT_EQ(grpc_core::SetBit(&bitset, 1), 10); - EXPECT_EQ(grpc_core::BitCount(bitset), 2); - EXPECT_EQ(grpc_core::ClearBit(&bitset, 3), 2); - EXPECT_EQ(grpc_core::BitCount(bitset), 1); - EXPECT_EQ(grpc_core::GetBit(bitset, 3), 0); - EXPECT_EQ(grpc_core::BitCount(std::numeric_limits::max()), 64); + EXPECT_EQ(BitCount((1u << 31) - 1), 31); + EXPECT_EQ(BitCount(1u << 3), 1); + EXPECT_EQ(BitCount(0), 0); + EXPECT_EQ(SetBit(&bitset, 3), 8); + EXPECT_EQ(BitCount(bitset), 1); + EXPECT_EQ(GetBit(bitset, 3), 1); + EXPECT_EQ(SetBit(&bitset, 1), 10); + EXPECT_EQ(BitCount(bitset), 2); + EXPECT_EQ(ClearBit(&bitset, 3), 2); + EXPECT_EQ(BitCount(bitset), 1); + EXPECT_EQ(GetBit(bitset, 3), 0); + EXPECT_EQ(BitCount(std::numeric_limits::max()), 64); } } // namespace grpc_core diff --git a/test/core/gprpp/stat_test.cc b/test/core/gprpp/stat_test.cc index 7f3a0073725..aac85d56272 100644 --- a/test/core/gprpp/stat_test.cc +++ b/test/core/gprpp/stat_test.cc @@ -46,8 +46,7 @@ TEST(STAT, GetTimestampOnTmpFile) { fclose(tmp); // Check the last modified date is correctly set. time_t timestamp = 0; - absl::Status status = - grpc_core::GetFileModificationTime(tmp_name, ×tamp); + absl::Status status = GetFileModificationTime(tmp_name, ×tamp); EXPECT_EQ(status.code(), absl::StatusCode::kOk); EXPECT_GT(timestamp, 0); // Clean up. @@ -57,8 +56,7 @@ TEST(STAT, GetTimestampOnTmpFile) { TEST(STAT, GetTimestampOnFailure) { time_t timestamp = 0; - absl::Status status = - grpc_core::GetFileModificationTime("/DOES_NOT_EXIST", ×tamp); + absl::Status status = GetFileModificationTime("/DOES_NOT_EXIST", ×tamp); EXPECT_EQ(status.code(), absl::StatusCode::kInternal); // Check the last modified date is not set. EXPECT_EQ(timestamp, 0); diff --git a/test/core/promise/promise_factory_test.cc b/test/core/promise/promise_factory_test.cc index b354dbe2fe5..ffe25daf28a 100644 --- a/test/core/promise/promise_factory_test.cc +++ b/test/core/promise/promise_factory_test.cc @@ -55,8 +55,7 @@ TEST(AdaptorTest, FactoryFromBindFrontPromise) { } TEST(AdaptorTest, FactoryFromCapturePromise) { - EXPECT_EQ(MakeFactory( - grpc_core::Capture([](int* i) { return Poll(*i); }, 42)) + EXPECT_EQ(MakeFactory(Capture([](int* i) { return Poll(*i); }, 42)) .Once()(), Poll(42)); } diff --git a/test/core/resource_quota/memory_quota_fuzzer.cc b/test/core/resource_quota/memory_quota_fuzzer.cc index 26d0ecc4082..7ff69bbfaeb 100644 --- a/test/core/resource_quota/memory_quota_fuzzer.cc +++ b/test/core/resource_quota/memory_quota_fuzzer.cc @@ -43,7 +43,7 @@ ReclamationPass MapReclamationPass(memory_quota_fuzzer::Reclaimer::Pass pass) { class Fuzzer { public: void Run(const memory_quota_fuzzer::Msg& msg) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; RunMsg(msg); do { memory_quotas_.clear(); diff --git a/test/core/security/tls_security_connector_test.cc b/test/core/security/tls_security_connector_test.cc index 2b1cc410ded..bed11724779 100644 --- a/test/core/security/tls_security_connector_test.cc +++ b/test/core/security/tls_security_connector_test.cc @@ -69,16 +69,14 @@ class TlsSecurityConnectorTest : public ::testing::Test { "load_file", grpc_load_file(SERVER_CERT_PATH_0, 1, &cert_slice_0))); GPR_ASSERT(GRPC_LOG_IF_ERROR( "load_file", grpc_load_file(SERVER_KEY_PATH_0, 1, &key_slice_0))); - root_cert_1_ = std::string(grpc_core::StringViewFromSlice(ca_slice_1)); - root_cert_0_ = std::string(grpc_core::StringViewFromSlice(ca_slice_0)); - std::string identity_key_1 = - std::string(grpc_core::StringViewFromSlice(key_slice_1)); - std::string identity_key_0 = - std::string(grpc_core::StringViewFromSlice(key_slice_0)); + root_cert_1_ = std::string(StringViewFromSlice(ca_slice_1)); + root_cert_0_ = std::string(StringViewFromSlice(ca_slice_0)); + std::string identity_key_1 = std::string(StringViewFromSlice(key_slice_1)); + std::string identity_key_0 = std::string(StringViewFromSlice(key_slice_0)); std::string identity_cert_1 = - std::string(grpc_core::StringViewFromSlice(cert_slice_1)); + std::string(StringViewFromSlice(cert_slice_1)); std::string identity_cert_0 = - std::string(grpc_core::StringViewFromSlice(cert_slice_0)); + std::string(StringViewFromSlice(cert_slice_0)); identity_pairs_1_.emplace_back(identity_key_1, identity_cert_1); identity_pairs_0_.emplace_back(identity_key_0, identity_cert_0); grpc_slice_unref(ca_slice_1); @@ -107,24 +105,23 @@ class TlsSecurityConnectorTest : public ::testing::Test { std::string root_cert_1_; std::string root_cert_0_; - grpc_core::PemKeyCertPairList identity_pairs_1_; - grpc_core::PemKeyCertPairList identity_pairs_0_; - grpc_core::HostNameCertificateVerifier hostname_certificate_verifier_; + PemKeyCertPairList identity_pairs_1_; + PemKeyCertPairList identity_pairs_0_; + HostNameCertificateVerifier hostname_certificate_verifier_; }; class TlsTestCertificateProvider : public ::grpc_tls_certificate_provider { public: explicit TlsTestCertificateProvider( - grpc_core::RefCountedPtr distributor) + RefCountedPtr distributor) : distributor_(std::move(distributor)) {} ~TlsTestCertificateProvider() override {} - grpc_core::RefCountedPtr distributor() - const override { + RefCountedPtr distributor() const override { return distributor_; } private: - grpc_core::RefCountedPtr distributor_; + RefCountedPtr distributor_; }; // @@ -133,29 +130,29 @@ class TlsTestCertificateProvider : public ::grpc_tls_certificate_provider { TEST_F(TlsSecurityConnectorTest, RootAndIdentityCertsObtainedWhenCreateChannelSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_); EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_); @@ -171,46 +168,44 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, SystemRootsWhenCreateChannelSecurityConnector) { // Create options watching for no certificates. - grpc_core::RefCountedPtr root_options = - grpc_core::MakeRefCounted(); - grpc_core::RefCountedPtr root_credential = - grpc_core::MakeRefCounted(root_options); + RefCountedPtr root_options = + MakeRefCounted(); + RefCountedPtr root_credential = + MakeRefCounted(root_options); grpc_channel_args* root_new_args = nullptr; - grpc_core::RefCountedPtr root_connector = + RefCountedPtr root_connector = root_credential->create_security_connector(nullptr, "some_target", nullptr, &root_new_args); EXPECT_NE(root_connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_root_connector = - static_cast( - root_connector.get()); + TlsChannelSecurityConnector* tls_root_connector = + static_cast(root_connector.get()); EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr); grpc_channel_args_destroy(root_new_args); } TEST_F(TlsSecurityConnectorTest, SystemRootsAndIdentityCertsObtainedWhenCreateChannelSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); // Create options only watching for identity certificates. - grpc_core::RefCountedPtr root_options = - grpc_core::MakeRefCounted(); + RefCountedPtr root_options = + MakeRefCounted(); root_options->set_certificate_provider(provider); root_options->set_watch_identity_pair(true); root_options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr root_credential = - grpc_core::MakeRefCounted(root_options); + RefCountedPtr root_credential = + MakeRefCounted(root_options); grpc_channel_args* root_new_args = nullptr; - grpc_core::RefCountedPtr root_connector = + RefCountedPtr root_connector = root_credential->create_security_connector(nullptr, "some_target", nullptr, &root_new_args); EXPECT_NE(root_connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_root_connector = - static_cast( - root_connector.get()); + TlsChannelSecurityConnector* tls_root_connector = + static_cast(root_connector.get()); EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_root_connector->KeyCertPairListForTesting(), identity_pairs_0_); // If we have a root update, we shouldn't receive them in security connector, @@ -223,29 +218,28 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, RootCertsObtainedWhenCreateChannelSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); // Create options only watching for root certificates. - grpc_core::RefCountedPtr root_options = - grpc_core::MakeRefCounted(); + RefCountedPtr root_options = + MakeRefCounted(); root_options->set_certificate_provider(provider); root_options->set_watch_root_cert(true); root_options->set_root_cert_name(kRootCertName); - grpc_core::RefCountedPtr root_credential = - grpc_core::MakeRefCounted(root_options); + RefCountedPtr root_credential = + MakeRefCounted(root_options); grpc_channel_args* root_new_args = nullptr; - grpc_core::RefCountedPtr root_connector = + RefCountedPtr root_connector = root_credential->create_security_connector(nullptr, "some_target", nullptr, &root_new_args); EXPECT_NE(root_connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_root_connector = - static_cast( - root_connector.get()); + TlsChannelSecurityConnector* tls_root_connector = + static_cast(root_connector.get()); EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_root_connector->RootCertsForTesting(), root_cert_0_); distributor->SetKeyMaterials(kRootCertName, root_cert_1_, absl::nullopt); @@ -256,29 +250,29 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CertPartiallyObtainedWhenCreateChannelSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); // Registered the options watching both certs, but only root certs are // available at distributor right now. - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); // The client_handshaker_factory_ shouldn't be updated. EXPECT_EQ(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_); @@ -294,29 +288,29 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, DistributorHasErrorForChannelSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_); EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_); @@ -336,12 +330,12 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CreateChannelSecurityConnectorFailNoTargetName) { - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr options = + MakeRefCounted(); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, nullptr, nullptr, &new_args); EXPECT_EQ(connector, nullptr); @@ -350,19 +344,19 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CreateChannelSecurityConnectorFailNoCredentials) { auto connector = - grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector( - nullptr, grpc_core::MakeRefCounted(), - nullptr, kTargetName, nullptr, nullptr); + TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector( + nullptr, MakeRefCounted(), nullptr, + kTargetName, nullptr, nullptr); EXPECT_EQ(connector, nullptr); } TEST_F(TlsSecurityConnectorTest, CreateChannelSecurityConnectorFailNoOptions) { - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr options = + MakeRefCounted(); + RefCountedPtr credential = + MakeRefCounted(options); auto connector = - grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector( + TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector( credential, nullptr, nullptr, kTargetName, nullptr, nullptr); EXPECT_EQ(connector, nullptr); } @@ -375,20 +369,20 @@ TEST_F(TlsSecurityConnectorTest, ChannelSecurityConnectorWithSyncExternalVerifierSucceeds) { auto* sync_verifier_ = new SyncExternalVerifier(true); ExternalCertificateVerifier core_external_verifier(sync_verifier_->base()); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(core_external_verifier.Ref()); options->set_check_call_host(false); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -399,8 +393,8 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; - grpc_core::ExecCtx exec_ctx; + RefCountedPtr auth_context; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx); tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked); @@ -411,20 +405,20 @@ TEST_F(TlsSecurityConnectorTest, ChannelSecurityConnectorWithSyncExternalVerifierFails) { auto* sync_verifier_ = new SyncExternalVerifier(false); ExternalCertificateVerifier core_external_verifier(sync_verifier_->base()); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(core_external_verifier.Ref()); options->set_check_call_host(false); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -435,11 +429,11 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; + RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " "SyncExternalVerifier failed"; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, const_cast(expected_error_msg), grpc_schedule_on_exec_ctx); @@ -449,21 +443,21 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CompareChannelSecurityConnectorSucceedsOnSameCredentials) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_root_cert_name(kRootCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_connector = credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); // Comparing the equality of security connectors generated from the same @@ -473,23 +467,23 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CompareChannelSecurityConnectorFailsOnDifferentChannelCredentials) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_root_cert_name(kRootCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); - grpc_core::RefCountedPtr other_credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_credential = + MakeRefCounted(options); + RefCountedPtr other_connector = other_credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); // Comparing the equality of security connectors generated from different @@ -499,26 +493,26 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CompareChannelSecurityConnectorFailsOnDifferentCallCredentials) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_root_cert_name(kRootCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); grpc_call_credentials* call_creds = grpc_md_only_test_credentials_create("", "", true); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_connector = credential->create_security_connector( - grpc_core::RefCountedPtr(call_creds), - kTargetName, nullptr, nullptr); + RefCountedPtr(call_creds), kTargetName, + nullptr, nullptr); // Comparing the equality of security connectors generated with different call // credentials should fail. EXPECT_NE(connector->cmp(other_connector.get()), 0); @@ -526,21 +520,21 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CompareChannelSecurityConnectorFailsOnDifferentTargetNames) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_root_cert_name(kRootCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, nullptr); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_connector = credential->create_security_connector(nullptr, "", nullptr, nullptr); // Comparing the equality of security connectors generated with different // target names should fail. @@ -553,19 +547,19 @@ TEST_F(TlsSecurityConnectorTest, auto* async_verifier = new AsyncExternalVerifier(true); auto* core_external_verifier = new ExternalCertificateVerifier(async_verifier->base()); - auto options = grpc_core::MakeRefCounted(); + auto options = MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(core_external_verifier->Ref()); options->set_check_call_host(false); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -576,8 +570,8 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; - grpc_core::ExecCtx exec_ctx; + RefCountedPtr auth_context; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx); tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked); @@ -590,19 +584,19 @@ TEST_F(TlsSecurityConnectorTest, auto* async_verifier = new AsyncExternalVerifier(false); auto* core_external_verifier = new ExternalCertificateVerifier(async_verifier->base()); - auto options = grpc_core::MakeRefCounted(); + auto options = MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(core_external_verifier->Ref()); options->set_check_call_host(false); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -613,11 +607,11 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; + RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " "AsyncExternalVerifier failed"; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, const_cast(expected_error_msg), grpc_schedule_on_exec_ctx); @@ -628,20 +622,20 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, ChannelSecurityConnectorHostnameVerifierSucceeds) { - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(hostname_certificate_verifier_.Ref()); options->set_check_call_host(false); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a full TSI Peer. tsi_peer peer; @@ -668,8 +662,8 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", &peer.properties[6]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; - grpc_core::ExecCtx exec_ctx; + RefCountedPtr auth_context; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx); tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked); @@ -678,19 +672,19 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, ChannelSecurityConnectorHostnameVerifierFails) { - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_verify_server_cert(true); options->set_certificate_verifier(hostname_certificate_verifier_.Ref()); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); + RefCountedPtr credential = + MakeRefCounted(options); grpc_channel_args* new_args = nullptr; - grpc_core::RefCountedPtr connector = + RefCountedPtr connector = credential->create_security_connector(nullptr, kTargetName, nullptr, &new_args); EXPECT_NE(connector, nullptr); - grpc_core::TlsChannelSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsChannelSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr); // Construct a full TSI Peer. tsi_peer peer; @@ -717,12 +711,12 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com", &peer.properties[6]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; + RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: Hostname " "Verification " "Check failed."; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, const_cast(expected_error_msg), grpc_schedule_on_exec_ctx); @@ -736,27 +730,27 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, RootAndIdentityCertsObtainedWhenCreateServerSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr); EXPECT_NE(connector, nullptr); - grpc_core::TlsServerSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsServerSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ServerHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_); EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_); @@ -774,27 +768,26 @@ TEST_F(TlsSecurityConnectorTest, // will hence fail on some systems. TEST_F(TlsSecurityConnectorTest, IdentityCertsObtainedWhenCreateServerSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); // Create options only watching for identity certificates. - grpc_core::RefCountedPtr identity_options = - grpc_core::MakeRefCounted(); + RefCountedPtr identity_options = + MakeRefCounted(); identity_options->set_certificate_provider(provider); identity_options->set_watch_identity_pair(true); identity_options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr identity_credential = - grpc_core::MakeRefCounted(identity_options); - grpc_core::RefCountedPtr identity_connector = + RefCountedPtr identity_credential = + MakeRefCounted(identity_options); + RefCountedPtr identity_connector = identity_credential->create_security_connector(nullptr); EXPECT_NE(identity_connector, nullptr); - grpc_core::TlsServerSecurityConnector* tls_identity_connector = - static_cast( - identity_connector.get()); + TlsServerSecurityConnector* tls_identity_connector = + static_cast(identity_connector.get()); EXPECT_NE(tls_identity_connector->ServerHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_identity_connector->KeyCertPairListForTesting(), @@ -809,28 +802,28 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CertPartiallyObtainedWhenCreateServerSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); // Registered the options watching both certs, but only root certs are // available at distributor right now. - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr); EXPECT_NE(connector, nullptr); - grpc_core::TlsServerSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsServerSecurityConnector* tls_connector = + static_cast(connector.get()); // The server_handshaker_factory_ shouldn't be updated. EXPECT_EQ(tls_connector->ServerHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_); @@ -844,27 +837,27 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, DistributorHasErrorForServerSecurityConnector) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + RefCountedPtr options = + MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_root_cert(true); options->set_watch_identity_pair(true); options->set_root_cert_name(kRootCertName); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr); EXPECT_NE(connector, nullptr); - grpc_core::TlsServerSecurityConnector* tls_connector = - static_cast(connector.get()); + TlsServerSecurityConnector* tls_connector = + static_cast(connector.get()); EXPECT_NE(tls_connector->ServerHandshakerFactoryForTesting(), nullptr); EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_); EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_); @@ -883,40 +876,38 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CreateServerSecurityConnectorFailNoCredentials) { - auto connector = - grpc_core::TlsServerSecurityConnector::CreateTlsServerSecurityConnector( - nullptr, grpc_core::MakeRefCounted()); + auto connector = TlsServerSecurityConnector::CreateTlsServerSecurityConnector( + nullptr, MakeRefCounted()); EXPECT_EQ(connector, nullptr); } TEST_F(TlsSecurityConnectorTest, CreateServerSecurityConnectorFailNoOptions) { - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - auto connector = - grpc_core::TlsServerSecurityConnector::CreateTlsServerSecurityConnector( - credential, nullptr); + RefCountedPtr options = + MakeRefCounted(); + RefCountedPtr credential = + MakeRefCounted(options); + auto connector = TlsServerSecurityConnector::CreateTlsServerSecurityConnector( + credential, nullptr); EXPECT_EQ(connector, nullptr); } TEST_F(TlsSecurityConnectorTest, CompareServerSecurityConnectorSucceedsOnSameCredentials) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_identity_pair(true); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_connector = credential->create_security_connector(nullptr); // Comparing the equality of security connectors generated from the same // server credentials with same settings should succeed. @@ -925,23 +916,23 @@ TEST_F(TlsSecurityConnectorTest, TEST_F(TlsSecurityConnectorTest, CompareServerSecurityConnectorFailsOnDifferentServerCredentials) { - grpc_core::RefCountedPtr distributor = - grpc_core::MakeRefCounted(); + RefCountedPtr distributor = + MakeRefCounted(); distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt, identity_pairs_0_); - grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider = - grpc_core::MakeRefCounted(distributor); - auto options = grpc_core::MakeRefCounted(); + RefCountedPtr<::grpc_tls_certificate_provider> provider = + MakeRefCounted(distributor); + auto options = MakeRefCounted(); options->set_certificate_provider(provider); options->set_watch_identity_pair(true); options->set_identity_cert_name(kIdentityCertName); - grpc_core::RefCountedPtr credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr connector = + RefCountedPtr credential = + MakeRefCounted(options); + RefCountedPtr connector = credential->create_security_connector(nullptr); - grpc_core::RefCountedPtr other_credential = - grpc_core::MakeRefCounted(options); - grpc_core::RefCountedPtr other_connector = + RefCountedPtr other_credential = + MakeRefCounted(options); + RefCountedPtr other_connector = other_credential->create_security_connector(nullptr); // Comparing the equality of security connectors generated from different // server credentials should fail. @@ -956,16 +947,15 @@ TEST_F(TlsSecurityConnectorTest, ServerSecurityConnectorWithSyncExternalVerifierSucceeds) { auto* sync_verifier = new SyncExternalVerifier(true); ExternalCertificateVerifier core_external_verifier(sync_verifier->base()); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE); options->set_certificate_verifier(core_external_verifier.Ref()); auto provider = - grpc_core::MakeRefCounted( - "", grpc_core::PemKeyCertPairList()); + MakeRefCounted("", PemKeyCertPairList()); options->set_certificate_provider(std::move(provider)); options->set_watch_identity_pair(true); - auto credentials = grpc_core::MakeRefCounted(options); + auto credentials = MakeRefCounted(options); auto connector = credentials->create_security_connector(nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -976,8 +966,8 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; - grpc_core::ExecCtx exec_ctx; + RefCountedPtr auth_context; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx); connector->check_peer(peer, nullptr, &auth_context, on_peer_checked); @@ -987,16 +977,15 @@ TEST_F(TlsSecurityConnectorTest, ServerSecurityConnectorWithSyncExternalVerifierFails) { auto* sync_verifier = new SyncExternalVerifier(false); ExternalCertificateVerifier core_external_verifier(sync_verifier->base()); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE); options->set_certificate_verifier(core_external_verifier.Ref()); auto provider = - grpc_core::MakeRefCounted( - "", grpc_core::PemKeyCertPairList()); + MakeRefCounted("", PemKeyCertPairList()); options->set_certificate_provider(std::move(provider)); options->set_watch_identity_pair(true); - auto credentials = grpc_core::MakeRefCounted(options); + auto credentials = MakeRefCounted(options); auto connector = credentials->create_security_connector(nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -1007,11 +996,11 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; + RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " "SyncExternalVerifier failed"; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, const_cast(expected_error_msg), grpc_schedule_on_exec_ctx); @@ -1023,15 +1012,14 @@ TEST_F(TlsSecurityConnectorTest, auto* async_verifier = new AsyncExternalVerifier(true); auto* core_external_verifier = new ExternalCertificateVerifier(async_verifier->base()); - auto options = grpc_core::MakeRefCounted(); + auto options = MakeRefCounted(); options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE); options->set_certificate_verifier(core_external_verifier->Ref()); auto provider = - grpc_core::MakeRefCounted( - "", grpc_core::PemKeyCertPairList()); + MakeRefCounted("", PemKeyCertPairList()); options->set_certificate_provider(std::move(provider)); options->set_watch_identity_pair(true); - auto credentials = grpc_core::MakeRefCounted(options); + auto credentials = MakeRefCounted(options); auto connector = credentials->create_security_connector(nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -1042,8 +1030,8 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; - grpc_core::ExecCtx exec_ctx; + RefCountedPtr auth_context; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx); connector->check_peer(peer, nullptr, &auth_context, on_peer_checked); @@ -1055,16 +1043,15 @@ TEST_F(TlsSecurityConnectorTest, auto* async_verifier = new AsyncExternalVerifier(false); auto* core_external_verifier = new ExternalCertificateVerifier(async_verifier->base()); - grpc_core::RefCountedPtr options = - grpc_core::MakeRefCounted(); + RefCountedPtr options = + MakeRefCounted(); options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE); options->set_certificate_verifier(core_external_verifier->Ref()); auto provider = - grpc_core::MakeRefCounted( - "", grpc_core::PemKeyCertPairList()); + MakeRefCounted("", PemKeyCertPairList()); options->set_certificate_provider(std::move(provider)); options->set_watch_identity_pair(true); - auto credentials = grpc_core::MakeRefCounted(options); + auto credentials = MakeRefCounted(options); auto connector = credentials->create_security_connector(nullptr); // Construct a basic TSI Peer. tsi_peer peer; @@ -1075,11 +1062,11 @@ TEST_F(TlsSecurityConnectorTest, GPR_ASSERT(tsi_construct_string_peer_property_from_cstring( TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com", &peer.properties[1]) == TSI_OK); - grpc_core::RefCountedPtr auth_context; + RefCountedPtr auth_context; const char* expected_error_msg = "Custom verification check failed with error: UNAUTHENTICATED: " "AsyncExternalVerifier failed"; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE( VerifyExpectedErrorCallback, const_cast(expected_error_msg), grpc_schedule_on_exec_ctx); diff --git a/test/core/transport/bdp_estimator_test.cc b/test/core/transport/bdp_estimator_test.cc index 6d5cc9a1924..47d6d6d9b9f 100644 --- a/test/core/transport/bdp_estimator_test.cc +++ b/test/core/transport/bdp_estimator_test.cc @@ -61,7 +61,7 @@ namespace { void AddSamples(BdpEstimator* estimator, int64_t* samples, size_t n) { estimator->AddIncomingBytes(1234567); inc_time(); - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; estimator->SchedulePing(); estimator->StartPing(); 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_time_from_millis(1, GPR_TIMESPAN))); - grpc_core::ExecCtx::Get()->InvalidateNow(); + ExecCtx::Get()->InvalidateNow(); estimator->CompletePing(); } diff --git a/test/core/transport/byte_stream_test.cc b/test/core/transport/byte_stream_test.cc index 014bb1d0cad..bd2ddf93f40 100644 --- a/test/core/transport/byte_stream_test.cc +++ b/test/core/transport/byte_stream_test.cc @@ -41,7 +41,7 @@ void NotCalledClosure(void* /*arg*/, grpc_error_handle /*error*/) { } TEST(SliceBufferByteStream, Basic) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // Create and populate slice buffer. grpc_slice_buffer buffer; grpc_slice_buffer_init(&buffer); @@ -73,7 +73,7 @@ TEST(SliceBufferByteStream, Basic) { } TEST(SliceBufferByteStream, Shutdown) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // Create and populate slice buffer. grpc_slice_buffer buffer; grpc_slice_buffer_init(&buffer); @@ -117,7 +117,7 @@ TEST(SliceBufferByteStream, Shutdown) { // TEST(CachingByteStream, Basic) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // Create and populate slice buffer byte stream. grpc_slice_buffer buffer; grpc_slice_buffer_init(&buffer); @@ -152,7 +152,7 @@ TEST(CachingByteStream, Basic) { } TEST(CachingByteStream, Reset) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // Create and populate slice buffer byte stream. grpc_slice_buffer buffer; grpc_slice_buffer_init(&buffer); @@ -194,7 +194,7 @@ TEST(CachingByteStream, Reset) { } TEST(CachingByteStream, SharedCache) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; // Create and populate slice buffer byte stream. grpc_slice_buffer buffer; grpc_slice_buffer_init(&buffer); diff --git a/test/core/transport/chttp2/context_list_test.cc b/test/core/transport/chttp2/context_list_test.cc index af791b3512f..3b77d03a64e 100644 --- a/test/core/transport/chttp2/context_list_test.cc +++ b/test/core/transport/chttp2/context_list_test.cc @@ -40,7 +40,7 @@ const uint32_t kByteOffset = 123; void* PhonyArgsCopier(void* arg) { return arg; } -void TestExecuteFlushesListVerifier(void* arg, grpc_core::Timestamps* ts, +void TestExecuteFlushesListVerifier(void* arg, Timestamps* ts, grpc_error_handle error) { ASSERT_NE(arg, nullptr); 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. */ TEST_F(ContextListTest, ExecuteFlushesList) { - grpc_core::ContextList* list = nullptr; + ContextList* list = nullptr; const int kNumElems = 5; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_stream_refcount ref; GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref"); grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write); - grpc_channel_args* args = - grpc_core::EnsureResourceQuotaInChannelArgs(nullptr); + grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr); grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true); grpc_channel_args_destroy(args); std::vector s; @@ -88,10 +87,10 @@ TEST_F(ContextListTest, ExecuteFlushesList) { s[i]->context = &verifier_called[i]; s[i]->byte_counter = kByteOffset; gpr_atm_rel_store(&verifier_called[i], static_cast(0)); - grpc_core::ContextList::Append(&list, s[i]); + ContextList::Append(&list, s[i]); } - grpc_core::Timestamps ts; - grpc_core::ContextList::Execute(list, &ts, GRPC_ERROR_NONE); + Timestamps ts; + ContextList::Execute(list, &ts, GRPC_ERROR_NONE); for (auto i = 0; i < kNumElems; i++) { EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast(1)); grpc_transport_destroy_stream(reinterpret_cast(t), @@ -105,29 +104,28 @@ TEST_F(ContextListTest, ExecuteFlushesList) { } TEST_F(ContextListTest, EmptyList) { - grpc_core::ContextList* list = nullptr; - grpc_core::ExecCtx exec_ctx; - grpc_core::Timestamps ts; - grpc_core::ContextList::Execute(list, &ts, GRPC_ERROR_NONE); + ContextList* list = nullptr; + ExecCtx exec_ctx; + Timestamps ts; + ContextList::Execute(list, &ts, GRPC_ERROR_NONE); exec_ctx.Flush(); } TEST_F(ContextListTest, EmptyListEmptyTimestamp) { - grpc_core::ContextList* list = nullptr; - grpc_core::ExecCtx exec_ctx; - grpc_core::ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); + ContextList* list = nullptr; + ExecCtx exec_ctx; + ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); exec_ctx.Flush(); } TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) { - grpc_core::ContextList* list = nullptr; + ContextList* list = nullptr; const int kNumElems = 5; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_stream_refcount ref; GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "phony ref"); grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write); - grpc_channel_args* args = - grpc_core::EnsureResourceQuotaInChannelArgs(nullptr); + grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr); grpc_transport* t = grpc_create_chttp2_transport(args, mock_endpoint, true); grpc_channel_args_destroy(args); std::vector s; @@ -142,9 +140,9 @@ TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) { s[i]->context = &verifier_called[i]; s[i]->byte_counter = kByteOffset; gpr_atm_rel_store(&verifier_called[i], static_cast(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++) { EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast(1)); grpc_transport_destroy_stream(reinterpret_cast(t), diff --git a/test/core/transport/chttp2/hpack_parser_table_test.cc b/test/core/transport/chttp2/hpack_parser_table_test.cc index ab4cb60bbcb..49fb5dbc275 100644 --- a/test/core/transport/chttp2/hpack_parser_table_test.cc +++ b/test/core/transport/chttp2/hpack_parser_table_test.cc @@ -47,7 +47,7 @@ void AssertIndex(const HPackTable* tbl, uint32_t idx, const char* key, } // namespace TEST(HpackParserTableTest, StaticTable) { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; HPackTable tbl; AssertIndex(&tbl, 1, ":authority", ""); @@ -117,7 +117,7 @@ TEST(HpackParserTableTest, ManyAdditions) { HPackTable tbl; int i; - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; for (i = 0; i < 100000; i++) { grpc_mdelem elem; @@ -126,13 +126,13 @@ TEST(HpackParserTableTest, ManyAdditions) { elem = grpc_mdelem_from_slices(grpc_slice_from_cpp_string(key), grpc_slice_from_cpp_string(value)); ASSERT_EQ(tbl.Add(HPackTable::Memento(elem)), GRPC_ERROR_NONE); - AssertIndex(&tbl, 1 + grpc_core::hpack_constants::kLastStaticEntry, - key.c_str(), value.c_str()); + AssertIndex(&tbl, 1 + hpack_constants::kLastStaticEntry, key.c_str(), + value.c_str()); if (i) { std::string key = absl::StrCat("K.", i - 1); std::string value = absl::StrCat("VALUE.", i - 1); - AssertIndex(&tbl, 2 + grpc_core::hpack_constants::kLastStaticEntry, - key.c_str(), value.c_str()); + AssertIndex(&tbl, 2 + hpack_constants::kLastStaticEntry, key.c_str(), + value.c_str()); } } } diff --git a/test/core/transport/chttp2/hpack_utils_test.cc b/test/core/transport/chttp2/hpack_utils_test.cc index 5cb89488bce..9a0fa087d38 100644 --- a/test/core/transport/chttp2/hpack_utils_test.cc +++ b/test/core/transport/chttp2/hpack_utils_test.cc @@ -29,7 +29,7 @@ static void VerifyAsciiHeaderSize(const char* key, const char* value, grpc_mdelem elem = grpc_mdelem_from_slices( maybe_intern(grpc_slice_from_static_string(key), intern_key), 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); GPR_ASSERT(expected_size == elem_size); 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), intern_value)); 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( reinterpret_cast(value), value_len); 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", intern_key, intern_value); grpc_init(); - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; uint8_t binary_value[BUFFER_SIZE] = {0}; for (uint8_t i = 0; i < BUFFER_SIZE; i++) { diff --git a/test/core/transport/chttp2/settings_timeout_test.cc b/test/core/transport/chttp2/settings_timeout_test.cc index 08880db8df2..7f249cd48de 100644 --- a/test/core/transport/chttp2/settings_timeout_test.cc +++ b/test/core/transport/chttp2/settings_timeout_test.cc @@ -108,7 +108,7 @@ class Client { : server_address_(server_address) {} void Connect() { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_resolved_addresses* server_addresses = nullptr; grpc_error_handle error = 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_add_pollset(pollset_set, pollset_); EventState state; - grpc_channel_args* args = - grpc_core::EnsureResourceQuotaInChannelArgs(nullptr); + grpc_channel_args* args = EnsureResourceQuotaInChannelArgs(nullptr); grpc_tcp_client_connect(state.closure(), &endpoint_, pollset_set, args, server_addresses->addrs, - grpc_core::ExecCtx::Get()->Now() + 1000); + ExecCtx::Get()->Now() + 1000); grpc_channel_args_destroy(args); ASSERT_TRUE(PollUntilDone( &state, @@ -137,13 +136,13 @@ class Client { // Reads until an error is returned. // Returns true if an error was encountered before the deadline. bool ReadUntilError() { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_slice_buffer read_buffer; grpc_slice_buffer_init(&read_buffer); bool retval = true; // 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. - grpc_millis deadline = grpc_core::ExecCtx::Get()->Now() + 3000; + grpc_millis deadline = ExecCtx::Get()->Now() + 3000; while (true) { EventState state; grpc_endpoint_read(endpoint_, &read_buffer, state.closure(), @@ -163,7 +162,7 @@ class Client { } void Shutdown() { - grpc_core::ExecCtx exec_ctx; + ExecCtx exec_ctx; grpc_endpoint_destroy(endpoint_); grpc_pollset_shutdown(pollset_, GRPC_CLOSURE_CREATE(&Client::PollsetDestroy, pollset_, @@ -209,13 +208,12 @@ class Client { gpr_mu_lock(mu_); GRPC_LOG_IF_ERROR( "grpc_pollset_work", - grpc_pollset_work(pollset_, &worker, - grpc_core::ExecCtx::Get()->Now() + 100)); + grpc_pollset_work(pollset_, &worker, ExecCtx::Get()->Now() + 100)); // Flushes any work scheduled before or during polling. - grpc_core::ExecCtx::Get()->Flush(); + ExecCtx::Get()->Flush(); gpr_mu_unlock(mu_); if (state != nullptr && state->done()) return true; - if (grpc_core::ExecCtx::Get()->Now() >= deadline) return false; + if (ExecCtx::Get()->Now() >= deadline) return false; } } diff --git a/test/core/util/stack_tracer.cc b/test/core/util/stack_tracer.cc index f611ff1e2f8..333bdea07ca 100644 --- a/test/core/util/stack_tracer.cc +++ b/test/core/util/stack_tracer.cc @@ -103,7 +103,7 @@ std::string GetCurrentStackTrace() { void InitializeStackTracer(const char* argv0) { absl::InitializeSymbolizer(argv0); - grpc_core::SetCurrentStackTraceProvider(&GetCurrentStackTrace); + SetCurrentStackTraceProvider(&GetCurrentStackTrace); } } // namespace testing diff --git a/test/core/util/tls_utils.cc b/test/core/util/tls_utils.cc index 6c9052cc46a..359bd5f128e 100644 --- a/test/core/util/tls_utils.cc +++ b/test/core/util/tls_utils.cc @@ -128,9 +128,8 @@ void AsyncExternalVerifier::Destruct(void* user_data) { auto* self = static_cast(user_data); // 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. - grpc_core::Thread destroy_thread( - "DestroyExternalVerifier", DestroyExternalVerifier, self, nullptr, - grpc_core::Thread::Options().set_joinable(false)); + Thread destroy_thread("DestroyExternalVerifier", DestroyExternalVerifier, + self, nullptr, Thread::Options().set_joinable(false)); destroy_thread.Start(); } diff --git a/test/core/util/tls_utils.h b/test/core/util/tls_utils.h index b87ad74c03d..2048f794b11 100644 --- a/test/core/util/tls_utils.h +++ b/test/core/util/tls_utils.h @@ -125,7 +125,7 @@ class AsyncExternalVerifier { static void WorkerThread(void* arg); bool success_ = false; - grpc_core::Thread thread_; + Thread thread_; grpc_tls_certificate_verifier_external base_; Mutex mu_; std::deque queue_ ABSL_GUARDED_BY(mu_); diff --git a/test/core/util/tracer_util.cc b/test/core/util/tracer_util.cc index e48ae0cc9be..df42eb921ed 100644 --- a/test/core/util/tracer_util.cc +++ b/test/core/util/tracer_util.cc @@ -22,9 +22,7 @@ namespace grpc_core { namespace testing { -void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag) { - flag->set_enabled(true); -} +void grpc_tracer_enable_flag(TraceFlag* flag) { flag->set_enabled(true); } } // namespace testing } // namespace grpc_core diff --git a/test/core/util/tracer_util.h b/test/core/util/tracer_util.h index 0b432ffa46a..7f9aa151edf 100644 --- a/test/core/util/tracer_util.h +++ b/test/core/util/tracer_util.h @@ -24,7 +24,7 @@ class TraceFlag; namespace testing { // enables the TraceFlag passed to it. Used for testing purposes. -void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag); +void grpc_tracer_enable_flag(TraceFlag* flag); } // namespace testing } // namespace grpc_core diff --git a/tools/distrib/check_redundant_namespace_qualifiers.py b/tools/distrib/check_redundant_namespace_qualifiers.py new file mode 100755 index 00000000000..a3834dfcc27 --- /dev/null +++ b/tools/distrib/check_redundant_namespace_qualifiers.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python +# Copyright 2021 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Eliminate the kind of redundant namespace qualifiers that tend to +# creep in when converting C to C++. + +import collections +import os +import re +import sys + + +def find_closing_mustache(contents, initial_depth): + """Find the closing mustache for a given number of open mustaches.""" + depth = initial_depth + start_len = len(contents) + while contents: + # Skip over strings. + if contents[0] == '"': + contents = contents[1:] + while contents[0] != '"': + if contents.startswith('\\\\'): + contents = contents[2:] + elif contents.startswith('\\"'): + contents = contents[2:] + else: + contents = contents[1:] + contents = contents[1:] + # And characters that might confuse us. + elif contents.startswith("'{'") or contents.startswith( + "'\"'") or contents.startswith("'}'"): + contents = contents[3:] + # Skip over comments. + elif contents.startswith("//"): + contents = contents[contents.find('\n'):] + elif contents.startswith("/*"): + contents = contents[contents.find('*/') + 2:] + # Count up or down if we see a mustache. + elif contents[0] == '{': + contents = contents[1:] + depth += 1 + elif contents[0] == '}': + contents = contents[1:] + depth -= 1 + if depth == 0: + return start_len - len(contents) + # Skip over everything else. + else: + contents = contents[1:] + return None + + +def update_file(contents, namespaces): + """Scan the contents of a file, and for top-level namespaces in namespaces remove redundant usages.""" + output = '' + while contents: + m = re.search(r'namespace ([a-zA-Z0-9_]*) {', contents) + if not m: + output += contents + break + output += contents[:m.end()] + contents = contents[m.end():] + end = find_closing_mustache(contents, 1) + if end is None: + print('Failed to find closing mustache for namespace {}'.format( + m.group(1))) + print('Remaining text:') + print(contents) + sys.exit(1) + body = contents[:end] + namespace = m.group(1) + if namespace in namespaces: + while body: + # Find instances of 'namespace::' + m = re.search(r'\b' + namespace + r'::\b', body) + if not m: + break + # But ignore instances of '::namespace::' -- these are usually meant to be there. + if m.start() >= 2 and body[m.start() - 2:].startswith('::'): + output += body[:m.end()] + else: + output += body[:m.start()] + body = body[m.end():] + output += body + contents = contents[end:] + return output + + +# self check before doing anything +_TEST = """ +namespace bar { + namespace baz { + } +} +namespace foo {} +namespace foo { + foo::a; +} +""" +_TEST_EXPECTED = """ +namespace bar { + namespace baz { + } +} +namespace foo {} +namespace foo { + a; +} +""" +output = update_file(_TEST, ['foo']) +if output != _TEST_EXPECTED: + import difflib + print('FAILED: self check') + print('\n'.join( + difflib.ndiff(_TEST_EXPECTED.splitlines(1), output.splitlines(1)))) + sys.exit(1) + +# Main loop. +Config = collections.namedtuple('Config', ['dirs', 'namespaces']) + +_CONFIGURATION = (Config(['src/core', 'test/core'], ['grpc_core']),) + +changed = [] + +for config in _CONFIGURATION: + for dir in config.dirs: + for root, dirs, files in os.walk(dir): + for file in files: + if file.endswith('.cc') or file.endswith('.h'): + path = os.path.join(root, file) + try: + with open(path) as f: + contents = f.read() + except IOError: + continue + updated = update_file(contents, config.namespaces) + if updated != contents: + changed.append(path) + with open(os.path.join(root, file), 'w') as f: + f.write(updated) + +if changed: + print('The following files were changed:') + for path in changed: + print(' ' + path) + sys.exit(1) diff --git a/tools/distrib/sanitize.sh b/tools/distrib/sanitize.sh index 7ab4fd72433..56e6920c024 100755 --- a/tools/distrib/sanitize.sh +++ b/tools/distrib/sanitize.sh @@ -28,4 +28,5 @@ tools/distrib/yapf_code.sh tools/distrib/isort_code.sh tools/distrib/clang_format_code.sh tools/distrib/buildifier_format_code_strict.sh || true +tools/distrib/check_redundant_namespace_qualifiers.py || true diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 712b94c0139..5744f413844 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -40,4 +40,5 @@ - script: tools/distrib/check_protobuf_pod_version.sh - script: tools/distrib/check_boringssl_prefix_symbol.sh - script: tools/run_tests/sanity/build_banned_constructs.sh +- script: tools/distrib/check_redundant_namespace_qualifiers.py