[c++14] absl::make_unique --> std::make_unique (#31159)

* [c++14] absl::make_unique --> std::make_unique

* fix

* fix
pull/31163/head
Craig Tiller 2 years ago committed by GitHub
parent c1853ade88
commit 9c98d67d7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 55
      BUILD
  2. 11
      src/core/ext/filters/client_channel/client_channel.cc
  3. 3
      src/core/ext/filters/client_channel/health/health_check_client.cc
  4. 7
      src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
  5. 15
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  6. 4
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
  7. 5
      src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc
  8. 2
      src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h
  9. 15
      src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc
  10. 19
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  11. 11
      src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
  12. 7
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  13. 13
      src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
  14. 15
      src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
  15. 13
      src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
  16. 9
      src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
  17. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds.h
  18. 11
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
  19. 9
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
  20. 13
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
  21. 3
      src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
  22. 6
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  23. 3
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
  24. 2
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  25. 7
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  26. 5
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  27. 3
      src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
  28. 5
      src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
  29. 9
      src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
  30. 3
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  31. 7
      src/core/ext/filters/client_channel/resolver_result_parsing.cc
  32. 7
      src/core/ext/filters/client_channel/retry_service_config.cc
  33. 5
      src/core/ext/filters/fault_injection/service_config_parser.cc
  34. 5
      src/core/ext/filters/message_size/message_size_filter.cc
  35. 13
      src/core/ext/filters/rbac/rbac_service_config_parser.cc
  36. 3
      src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
  37. 2
      src/core/ext/transport/binder/client/endpoint_binder_pool.cc
  38. 2
      src/core/ext/transport/binder/server/binder_server_credentials.cc
  39. 5
      src/core/ext/transport/binder/transport/binder_transport.cc
  40. 6
      src/core/ext/transport/binder/wire_format/binder_android.cc
  41. 2
      src/core/ext/transport/binder/wire_format/binder_android.h
  42. 3
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  43. 3
      src/core/ext/xds/file_watcher_certificate_provider_factory.cc
  44. 3
      src/core/ext/xds/xds_bootstrap_grpc.cc
  45. 23
      src/core/ext/xds/xds_certificate_provider.cc
  46. 5
      src/core/ext/xds/xds_client.cc
  47. 3
      src/core/ext/xds/xds_cluster.cc
  48. 3
      src/core/ext/xds/xds_cluster_specifier_plugin.cc
  49. 5
      src/core/ext/xds/xds_endpoint.cc
  50. 9
      src/core/ext/xds/xds_http_filters.cc
  51. 7
      src/core/ext/xds/xds_lb_policy_registry.cc
  52. 3
      src/core/ext/xds/xds_listener.cc
  53. 9
      src/core/ext/xds/xds_route_config.cc
  54. 5
      src/core/lib/channel/promise_based_filter.cc
  55. 6
      src/core/lib/event_engine/default_event_engine_factory.cc
  56. 8
      src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc
  57. 3
      src/core/lib/event_engine/posix_engine/timer_manager.cc
  58. 3
      src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc
  59. 3
      src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc
  60. 3
      src/core/lib/iomgr/iomgr_posix.cc
  61. 3
      src/core/lib/iomgr/iomgr_posix_cfstream.cc
  62. 3
      src/core/lib/iomgr/iomgr_windows.cc
  63. 7
      src/core/lib/matchers/matchers.cc
  64. 4
      src/core/lib/resolver/server_address.h
  65. 3
      src/core/lib/security/authorization/cel_authorization_engine.cc
  66. 4
      src/core/lib/security/authorization/grpc_authorization_engine.cc
  67. 4
      src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
  68. 43
      src/core/lib/security/authorization/matchers.cc
  69. 4
      src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
  70. 3
      src/core/lib/security/authorization/mock_cel/cel_value.h
  71. 5
      src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
  72. 5
      src/core/lib/security/authorization/rbac_policy.cc
  73. 15
      src/core/lib/security/authorization/rbac_translator.cc
  74. 7
      src/core/lib/security/credentials/channel_creds_registry_init.cc
  75. 3
      src/core/lib/security/credentials/external/aws_external_account_credentials.cc
  76. 5
      src/core/lib/security/security_connector/tls/tls_security_connector.cc
  77. 5
      src/core/lib/security/transport/security_handshaker.cc
  78. 3
      src/core/lib/service_config/service_config_impl.cc
  79. 3
      src/core/lib/surface/lame_client.cc
  80. 13
      src/core/lib/surface/server.cc
  81. 3
      src/core/lib/surface/server.h
  82. 3
      src/core/lib/transport/http_connect_handshaker.cc
  83. 3
      src/core/lib/transport/tcp_connect_handshaker.cc
  84. 2
      src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
  85. 2
      src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
  86. 3
      src/cpp/common/alts_util.cc
  87. 3
      src/cpp/server/health/default_health_check_service.cc
  88. 12
      src/cpp/server/load_reporter/load_reporter_async_service_impl.cc
  89. 3
      src/cpp/server/orca/orca_interceptor.cc
  90. 9
      src/cpp/server/server_cc.cc
  91. 4
      test/core/channel/channelz_test.cc
  92. 5
      test/core/client_channel/resolvers/binder_resolver_test.cc
  93. 2
      test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
  94. 4
      test/core/client_channel/resolvers/dns_resolver_test.cc
  95. 4
      test/core/client_channel/resolvers/sockaddr_resolver_test.cc
  96. 20
      test/core/client_channel/service_config_test.cc
  97. 2
      test/core/end2end/BUILD
  98. 7
      test/core/end2end/fuzzers/api_fuzzer.cc
  99. 5
      test/core/end2end/goaway_server_test.cc
  100. 4
      test/core/end2end/invalid_call_argument_test.cc
  101. Some files were not shown because too many files have changed in this diff Show More

55
BUILD

@ -910,10 +910,7 @@ grpc_cc_library(
"include/grpcpp/security/alts_context.h",
"include/grpcpp/security/alts_util.h",
],
external_deps = [
"absl/memory",
"upb_lib",
],
external_deps = ["upb_lib"],
language = "c++",
standalone = True,
visibility = ["@grpc:tsi"],
@ -1902,7 +1899,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/strings",
"absl/types:optional",
@ -1938,7 +1934,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2535,7 +2530,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/time",
"absl/types:optional",
],
@ -2620,7 +2614,6 @@ grpc_cc_library(
"src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2641,7 +2634,6 @@ grpc_cc_library(
"src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2686,7 +2678,6 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/functional:function_ref",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3365,7 +3356,6 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/functional:any_invocable",
"absl/functional:function_ref",
"absl/memory",
"absl/meta:type_traits",
"absl/status",
"absl/status:statusor",
@ -3584,7 +3574,6 @@ grpc_cc_library(
"src/core/lib/service_config/service_config_impl.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3634,7 +3623,6 @@ grpc_cc_library(
"src/core/lib/resolver/server_address.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3899,7 +3887,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4006,7 +3993,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
@ -4164,7 +4150,6 @@ grpc_cc_library(
"src/core/ext/filters/message_size/message_size_filter.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4203,7 +4188,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/random",
"absl/status",
"absl/status:statusor",
@ -4241,7 +4225,6 @@ grpc_cc_library(
"src/core/ext/filters/rbac/rbac_service_config_parser.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4358,7 +4341,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4433,7 +4415,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/hash",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4830,10 +4811,7 @@ grpc_cc_library(
srcs = [
"src/core/lib/security/credentials/channel_creds_registry_init.cc",
],
external_deps = [
"absl/memory",
"absl/strings",
],
external_deps = ["absl/strings"],
language = "c++",
deps = [
"channel_creds_registry",
@ -4875,7 +4853,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/xds/cds.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4925,7 +4902,6 @@ grpc_cc_library(
hdrs = [
"src/core/ext/filters/client_channel/lb_policy/xds/xds.h",
],
external_deps = ["absl/memory"],
language = "c++",
deps = [
"gpr_platform",
@ -4941,7 +4917,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4989,7 +4964,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5032,7 +5006,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5078,7 +5051,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/address_filtering.h",
],
external_deps = [
"absl/memory",
"absl/status:statusor",
"absl/strings",
],
@ -5120,7 +5092,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5158,7 +5129,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5200,7 +5170,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5249,7 +5218,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc",
],
external_deps = [
"absl/memory",
"absl/random",
"absl/status",
"absl/status:statusor",
@ -5293,7 +5261,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/priority/priority.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5336,7 +5303,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5588,7 +5554,6 @@ grpc_cc_library(
],
external_deps = [
"absl/functional:bind_front",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5632,7 +5597,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:flat_hash_set",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5680,7 +5644,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc",
],
external_deps = [
"absl/memory",
"absl/status:statusor",
"absl/strings",
],
@ -5704,7 +5667,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5729,7 +5691,6 @@ grpc_cc_library(
hdrs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5775,7 +5736,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc",
],
external_deps = [
"absl/memory",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -5824,7 +5784,6 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6229,7 +6188,6 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/functional:bind_front",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6400,7 +6358,6 @@ grpc_cc_library(
"src/core/lib/security/credentials/external/url_external_account_credentials.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6500,7 +6457,6 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6714,7 +6670,6 @@ grpc_cc_library(
"src/core/lib/security/authorization/mock_cel/flat_expr_builder.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6737,7 +6692,6 @@ grpc_cc_library(
"src/core/lib/matchers/matchers.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6763,7 +6717,6 @@ grpc_cc_library(
"src/core/lib/security/authorization/rbac_policy.h",
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6794,7 +6747,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6848,7 +6800,6 @@ grpc_cc_library(
],
external_deps = [
"absl/container:flat_hash_set",
"absl/memory",
"absl/strings",
"absl/types:optional",
"absl/types:span",
@ -7112,7 +7063,6 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -7466,7 +7416,6 @@ grpc_cc_library(
"src/cpp/server/orca/orca_interceptor.h",
],
external_deps = [
"absl/memory",
"absl/strings",
"absl/types:optional",
],

@ -27,7 +27,6 @@
#include <set>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/cord.h"
@ -1328,7 +1327,7 @@ void ClientChannel::OnResolverErrorLocked(absl::Status status) {
// Update connectivity state.
UpdateStateAndPickerLocked(
GRPC_CHANNEL_TRANSIENT_FAILURE, status, "resolver failure",
absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
std::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
}
}
@ -1368,7 +1367,7 @@ OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
LoadBalancingPolicy::Args lb_policy_args;
lb_policy_args.work_serializer = work_serializer_;
lb_policy_args.channel_control_helper =
absl::make_unique<ClientChannelControlHelper>(this);
std::make_unique<ClientChannelControlHelper>(this);
lb_policy_args.args = args;
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
@ -1502,13 +1501,13 @@ void ClientChannel::CreateResolverLocked() {
}
resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
uri_to_resolve_.c_str(), channel_args_, interested_parties_,
work_serializer_, absl::make_unique<ResolverResultHandler>(this));
work_serializer_, std::make_unique<ResolverResultHandler>(this));
// Since the validity of the args was checked when the channel was created,
// CreateResolver() must return a non-null result.
GPR_ASSERT(resolver_ != nullptr);
UpdateStateAndPickerLocked(
GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving",
absl::make_unique<LoadBalancingPolicy::QueuePicker>(nullptr));
std::make_unique<LoadBalancingPolicy::QueuePicker>(nullptr));
resolver_->StartLocked();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: created resolver=%p", this, resolver_.get());
@ -1714,7 +1713,7 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
disconnect_error_ = op->disconnect_with_error;
UpdateStateAndPickerLocked(
GRPC_CHANNEL_SHUTDOWN, absl::Status(), "shutdown from API",
absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
std::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
grpc_error_to_absl_status(op->disconnect_with_error)));
}
}

@ -25,7 +25,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -165,7 +164,7 @@ OrphanablePtr<SubchannelStreamClient> MakeHealthCheckClient(
RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
return MakeOrphanable<SubchannelStreamClient>(
std::move(connected_subchannel), interested_parties,
absl::make_unique<HealthStreamEventHandler>(std::move(service_name),
std::make_unique<HealthStreamEventHandler>(std::move(service_name),
std::move(channelz_node),
std::move(watcher)),
GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)

@ -23,7 +23,6 @@
#include <algorithm>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
@ -41,7 +40,7 @@ class HierarchicalPathAttribute : public ServerAddress::AttributeInterface {
: path_(std::move(path)) {}
std::unique_ptr<AttributeInterface> Copy() const override {
return absl::make_unique<HierarchicalPathAttribute>(path_);
return std::make_unique<HierarchicalPathAttribute>(path_);
}
int Cmp(const AttributeInterface* other) const override {
@ -70,7 +69,7 @@ class HierarchicalPathAttribute : public ServerAddress::AttributeInterface {
std::unique_ptr<ServerAddress::AttributeInterface>
MakeHierarchicalPathAttribute(std::vector<std::string> path) {
return absl::make_unique<HierarchicalPathAttribute>(std::move(path));
return std::make_unique<HierarchicalPathAttribute>(std::move(path));
}
absl::StatusOr<HierarchicalAddressMap> MakeHierarchicalAddressMap(
@ -89,7 +88,7 @@ absl::StatusOr<HierarchicalAddressMap> MakeHierarchicalAddressMap(
++it;
if (it != path.end()) {
std::vector<std::string> remaining_path(it, path.end());
new_attribute = absl::make_unique<HierarchicalPathAttribute>(
new_attribute = std::make_unique<HierarchicalPathAttribute>(
std::move(remaining_path));
}
target_list.emplace_back(address.WithAttribute(

@ -69,7 +69,6 @@
#include <vector>
#include "absl/container/inlined_vector.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -340,7 +339,7 @@ class GrpcLb : public LoadBalancingPolicy {
client_stats_(std::move(client_stats)) {}
std::unique_ptr<AttributeInterface> Copy() const override {
return absl::make_unique<TokenAndClientStatsAttribute>(lb_token_,
return std::make_unique<TokenAndClientStatsAttribute>(lb_token_,
client_stats_);
}
@ -707,7 +706,7 @@ ServerAddressList GrpcLb::Serverlist::GetServerAddressList(
std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
attributes;
attributes[kGrpcLbAddressAttributeKey] =
absl::make_unique<TokenAndClientStatsAttribute>(std::move(lb_token),
std::make_unique<TokenAndClientStatsAttribute>(std::move(lb_token),
stats);
// Add address.
addresses.emplace_back(addr, ChannelArgs(), std::move(attributes));
@ -762,7 +761,7 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
GrpcLbClientStats* client_stats = subchannel_wrapper->client_stats();
if (client_stats != nullptr) {
complete_pick->subchannel_call_tracker =
absl::make_unique<SubchannelCallTracker>(
std::make_unique<SubchannelCallTracker>(
client_stats->Ref(),
std::move(complete_pick->subchannel_call_tracker));
// The metadata value is a hack: we pretend the pointer points to
@ -852,7 +851,7 @@ void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
}
parent_->channel_control_helper()->UpdateState(
state, status,
absl::make_unique<Picker>(std::move(serverlist), std::move(picker),
std::make_unique<Picker>(std::move(serverlist), std::move(picker),
std::move(client_stats)));
}
@ -1566,7 +1565,7 @@ absl::Status GrpcLb::UpdateLocked(UpdateArgs args) {
for (ServerAddress& address : *fallback_backend_addresses_) {
address = address.WithAttribute(
kGrpcLbAddressAttributeKey,
absl::make_unique<TokenAndClientStatsAttribute>("", nullptr));
std::make_unique<TokenAndClientStatsAttribute>("", nullptr));
}
}
resolution_note_ = std::move(args.resolution_note);
@ -1777,7 +1776,7 @@ OrphanablePtr<LoadBalancingPolicy> GrpcLb::CreateChildPolicyLocked(
LoadBalancingPolicy::Args lb_policy_args;
lb_policy_args.work_serializer = work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper = absl::make_unique<Helper>(Ref());
lb_policy_args.channel_control_helper = std::make_unique<Helper>(Ref());
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_lb_glb_trace);
@ -1912,7 +1911,7 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
namespace grpc_core {
void RegisterGrpcLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<GrpcLbFactory>());
std::make_unique<GrpcLbFactory>());
builder->channel_init()->RegisterStage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
[](ChannelStackBuilder* builder) {

@ -22,8 +22,6 @@
#include <string.h>
#include "absl/memory/memory.h"
#include <grpc/support/atm.h>
#include <grpc/support/string_util.h>
@ -54,7 +52,7 @@ void GrpcLbClientStats::AddCallDropped(const char* token) {
// Record the drop.
MutexLock lock(&drop_count_mu_);
if (drop_token_counts_ == nullptr) {
drop_token_counts_ = absl::make_unique<DroppedCallCounts>();
drop_token_counts_ = std::make_unique<DroppedCallCounts>();
}
for (size_t i = 0; i < drop_token_counts_->size(); ++i) {
if (strcmp((*drop_token_counts_)[i].token.get(), token) == 0) {

@ -27,7 +27,6 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
@ -348,7 +347,7 @@ void OrcaProducer::MaybeStartStreamLocked() {
if (connected_subchannel_ == nullptr) return;
stream_client_ = MakeOrphanable<SubchannelStreamClient>(
connected_subchannel_, subchannel_->pollset_set(),
absl::make_unique<OrcaStreamEventHandler>(WeakRef(), report_interval_),
std::make_unique<OrcaStreamEventHandler>(WeakRef(), report_interval_),
GRPC_TRACE_FLAG_ENABLED(grpc_orca_client_trace) ? "OrcaClient" : nullptr);
}
@ -410,7 +409,7 @@ void OrcaWatcher::SetSubchannel(Subchannel* subchannel) {
std::unique_ptr<SubchannelInterface::DataWatcherInterface>
MakeOobBackendMetricWatcher(Duration report_interval,
std::unique_ptr<OobBackendMetricWatcher> watcher) {
return absl::make_unique<OrcaWatcher>(report_interval, std::move(watcher));
return std::make_unique<OrcaWatcher>(report_interval, std::move(watcher));
}
} // namespace grpc_core

@ -38,7 +38,7 @@ namespace grpc_core {
// subchannel like this:
// subchannel->AddDataWatcher(
// MakeOobBackendMetricWatcher(
// absl::make_unique<MyOobBackendMetricWatcherSubclass>(...)));
// std::make_unique<MyOobBackendMetricWatcherSubclass>(...)));
class OobBackendMetricWatcher {
public:

@ -32,7 +32,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/random/random.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
@ -307,8 +306,8 @@ class OutlierDetectionLb : public LoadBalancingPolicy {
}
private:
std::unique_ptr<Bucket> current_bucket_ = absl::make_unique<Bucket>();
std::unique_ptr<Bucket> backup_bucket_ = absl::make_unique<Bucket>();
std::unique_ptr<Bucket> current_bucket_ = std::make_unique<Bucket>();
std::unique_ptr<Bucket> backup_bucket_ = std::make_unique<Bucket>();
// The bucket used to update call counts.
// Points to either current_bucket or active_bucket.
std::atomic<Bucket*> active_bucket_{current_bucket_.get()};
@ -434,7 +433,7 @@ void OutlierDetectionLb::SubchannelWrapper::WatchConnectivityState(
std::unique_ptr<ConnectivityStateWatcherInterface> watcher) {
ConnectivityStateWatcherInterface* watcher_ptr = watcher.get();
auto watcher_wrapper =
absl::make_unique<WatcherWrapper>(std::move(watcher), ejected_);
std::make_unique<WatcherWrapper>(std::move(watcher), ejected_);
watchers_.emplace(watcher_ptr, watcher_wrapper.get());
wrapped_subchannel()->WatchConnectivityState(std::move(watcher_wrapper));
}
@ -530,7 +529,7 @@ LoadBalancingPolicy::PickResult OutlierDetectionLb::Picker::Pick(
// not both success_rate_ejection and failure_percentage_ejection are unset.
if (counting_enabled_) {
complete_pick->subchannel_call_tracker =
absl::make_unique<SubchannelCallTracker>(
std::make_unique<SubchannelCallTracker>(
std::move(complete_pick->subchannel_call_tracker),
subchannel_wrapper->subchannel_state());
}
@ -693,7 +692,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) {
void OutlierDetectionLb::MaybeUpdatePickerLocked() {
if (picker_ != nullptr) {
auto outlier_detection_picker =
absl::make_unique<Picker>(this, picker_, config_->CountingEnabled());
std::make_unique<Picker>(this, picker_, config_->CountingEnabled());
if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) {
gpr_log(GPR_INFO,
"[outlier_detection_lb %p] updating connectivity: state=%s "
@ -712,7 +711,7 @@ OrphanablePtr<LoadBalancingPolicy> OutlierDetectionLb::CreateChildPolicyLocked(
lb_policy_args.work_serializer = work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_outlier_detection_lb_trace);
@ -1131,7 +1130,7 @@ void OutlierDetectionConfig::JsonPostLoad(const Json& json, const JsonArgs&,
void RegisterOutlierDetectionLbPolicy(CoreConfiguration::Builder* builder) {
if (XdsOutlierDetectionEnabled()) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<OutlierDetectionLbFactory>());
std::make_unique<OutlierDetectionLbFactory>());
}
}

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -241,14 +240,14 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
: latest_update_args_.addresses.status();
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
channel_control_helper()->RequestReresolution();
}
// Otherwise, if this is the initial update, report CONNECTING.
else if (subchannel_list_.get() == nullptr) {
channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
std::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
}
// If the new update is empty or we don't yet have a selected subchannel in
// the current list, replace the current subchannel list immediately.
@ -340,11 +339,11 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
.ToString()));
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
} else {
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(
std::make_unique<QueuePicker>(
p->Ref(DEBUG_LOCATION, "QueuePicker")));
}
return;
@ -362,7 +361,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
p->subchannel_list_.reset();
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_IDLE, absl::Status(),
absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
std::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
return;
}
// If we get here, there are two possible cases:
@ -436,7 +435,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
connectivity_status().ToString()));
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
}
}
// If the next subchannel is in IDLE, trigger a connection attempt.
@ -462,7 +461,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
!subchannel_list()->in_transient_failure()) {
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(
std::make_unique<QueuePicker>(
p->Ref(DEBUG_LOCATION, "QueuePicker")));
}
break;
@ -503,7 +502,7 @@ void PickFirst::PickFirstSubchannelData::ProcessUnselectedReadyLocked() {
p->selected_ = this;
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_READY, absl::Status(),
absl::make_unique<Picker>(subchannel()->Ref()));
std::make_unique<Picker>(subchannel()->Ref()));
for (size_t i = 0; i < subchannel_list()->num_subchannels(); ++i) {
if (i != Index()) {
subchannel_list()->subchannel(i)->ShutdownLocked();
@ -539,7 +538,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
void RegisterPickFirstLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<PickFirstFactory>());
std::make_unique<PickFirstFactory>());
}
} // namespace grpc_core

@ -26,7 +26,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -421,7 +420,7 @@ void PriorityLb::ChoosePriorityLocked() {
absl::UnavailableError("priority policy has empty priority list");
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
return;
}
// Iterate through priorities, searching for one in READY or IDLE,
@ -687,10 +686,10 @@ void PriorityLb::ChildPriority::Orphan() {
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker>
PriorityLb::ChildPriority::GetPicker() {
if (picker_wrapper_ == nullptr) {
return absl::make_unique<QueuePicker>(
return std::make_unique<QueuePicker>(
priority_policy_->Ref(DEBUG_LOCATION, "QueuePicker"));
}
return absl::make_unique<RefCountedPickerWrapper>(picker_wrapper_);
return std::make_unique<RefCountedPickerWrapper>(picker_wrapper_);
}
absl::Status PriorityLb::ChildPriority::UpdateLocked(
@ -731,7 +730,7 @@ PriorityLb::ChildPriority::CreateChildPolicyLocked(const ChannelArgs& args) {
lb_policy_args.work_serializer = priority_policy_->work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_lb_priority_trace);
@ -944,7 +943,7 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
void RegisterPriorityLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<PriorityLbFactory>());
std::make_unique<PriorityLbFactory>());
}
} // namespace grpc_core

@ -32,7 +32,6 @@
#include "absl/base/attributes.h"
#include "absl/base/thread_annotations.h"
#include "absl/container/inlined_vector.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/numbers.h"
@ -661,7 +660,7 @@ void RingHash::RingHashSubchannelList::UpdateRingHashConnectivityStateLocked(
// Note that we use our own picker regardless of connectivity state.
p->channel_control_helper()->UpdateState(
state, status,
absl::make_unique<Picker>(Ref(DEBUG_LOCATION, "RingHashPicker")));
std::make_unique<Picker>(Ref(DEBUG_LOCATION, "RingHashPicker")));
// While the ring_hash policy is reporting TRANSIENT_FAILURE, it will
// not be getting any pick requests from the priority policy.
// However, because the ring_hash policy does not attempt to
@ -848,7 +847,7 @@ absl::Status RingHash::UpdateLocked(UpdateArgs args) {
: args.addresses.status();
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
return status;
}
// Otherwise, report IDLE.
@ -885,7 +884,7 @@ class RingHashFactory : public LoadBalancingPolicyFactory {
void RegisterRingHashLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<RingHashFactory>());
std::make_unique<RingHashFactory>());
}
} // namespace grpc_core

@ -40,7 +40,6 @@
#include "absl/base/thread_annotations.h"
#include "absl/hash/hash.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -728,7 +727,7 @@ RlsLb::ChildPolicyWrapper::ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy,
: nullptr),
lb_policy_(lb_policy),
target_(std::move(target)),
picker_(absl::make_unique<QueuePicker>(std::move(lb_policy))) {
picker_(std::make_unique<QueuePicker>(std::move(lb_policy))) {
lb_policy_->child_policy_map_.emplace(target_, this);
}
@ -809,7 +808,7 @@ void RlsLb::ChildPolicyWrapper::StartUpdate() {
config.status().ToString().c_str());
}
pending_config_.reset();
picker_ = absl::make_unique<TransientFailurePicker>(
picker_ = std::make_unique<TransientFailurePicker>(
absl::UnavailableError(config.status().message()));
child_policy_.reset();
} else {
@ -825,7 +824,7 @@ absl::Status RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() {
if (child_policy_ == nullptr) {
Args create_args;
create_args.work_serializer = lb_policy_->work_serializer();
create_args.channel_control_helper = absl::make_unique<ChildPolicyHelper>(
create_args.channel_control_helper = std::make_unique<ChildPolicyHelper>(
WeakRef(DEBUG_LOCATION, "ChildPolicyHelper"));
create_args.args = lb_policy_->channel_args_;
child_policy_ = MakeOrphanable<ChildPolicyHandler>(std::move(create_args),
@ -1156,7 +1155,7 @@ void RlsLb::Cache::Entry::BackoffTimer::OnBackoffTimer(
//
std::unique_ptr<BackOff> MakeCacheEntryBackoff() {
return absl::make_unique<BackOff>(
return std::make_unique<BackOff>(
BackOff::Options()
.set_initial_backoff(kCacheBackoffInitial)
.set_multiplier(kCacheBackoffMultiplier)
@ -2140,7 +2139,7 @@ void RlsLb::UpdatePickerLocked() {
status = absl::UnavailableError("no children available");
}
channel_control_helper()->UpdateState(
state, status, absl::make_unique<Picker>(Ref(DEBUG_LOCATION, "Picker")));
state, status, std::make_unique<Picker>(Ref(DEBUG_LOCATION, "Picker")));
}
//
@ -2504,7 +2503,7 @@ class RlsLbFactory : public LoadBalancingPolicyFactory {
void RegisterRlsLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<RlsLbFactory>());
std::make_unique<RlsLbFactory>());
}
} // namespace grpc_core

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -307,7 +306,7 @@ absl::Status RoundRobin::UpdateLocked(UpdateArgs args) {
: args.addresses.status();
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
return status;
}
// Otherwise, if this is the initial update, immediately promote it to
@ -316,7 +315,7 @@ absl::Status RoundRobin::UpdateLocked(UpdateArgs args) {
subchannel_list_ = std::move(latest_pending_subchannel_list_);
channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
std::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
}
return absl::OkStatus();
}
@ -387,8 +386,8 @@ void RoundRobin::RoundRobinSubchannelList::
gpr_log(GPR_INFO, "[RR %p] reporting READY with subchannel list %p", p,
this);
}
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_READY, absl::Status(), absl::make_unique<Picker>(p, this));
p->channel_control_helper()->UpdateState(GRPC_CHANNEL_READY, absl::Status(),
std::make_unique<Picker>(p, this));
} else if (num_connecting_ > 0) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
gpr_log(GPR_INFO, "[RR %p] reporting CONNECTING with subchannel list %p",
@ -396,7 +395,7 @@ void RoundRobin::RoundRobinSubchannelList::
}
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
std::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
} else if (num_transient_failure_ == num_subchannels()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
gpr_log(GPR_INFO,
@ -410,7 +409,7 @@ void RoundRobin::RoundRobinSubchannelList::
}
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, last_failure_,
absl::make_unique<TransientFailurePicker>(last_failure_));
std::make_unique<TransientFailurePicker>(last_failure_));
}
}
@ -525,7 +524,7 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
void RegisterRoundRobinLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<RoundRobinFactory>());
std::make_unique<RoundRobinFactory>());
}
} // namespace grpc_core

@ -26,7 +26,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -363,7 +362,7 @@ absl::Status WeightedTargetLb::UpdateLocked(UpdateArgs args) {
"no children in weighted_target policy: ", args.resolution_note));
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
return absl::OkStatus();
}
UpdateStateLocked();
@ -459,15 +458,15 @@ void WeightedTargetLb::UpdateStateLocked() {
absl::Status status;
switch (connectivity_state) {
case GRPC_CHANNEL_READY:
picker = absl::make_unique<WeightedPicker>(std::move(ready_picker_list));
picker = std::make_unique<WeightedPicker>(std::move(ready_picker_list));
break;
case GRPC_CHANNEL_CONNECTING:
case GRPC_CHANNEL_IDLE:
picker =
absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
std::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
break;
default:
picker = absl::make_unique<WeightedPicker>(std::move(tf_picker_list));
picker = std::make_unique<WeightedPicker>(std::move(tf_picker_list));
}
channel_control_helper()->UpdateState(connectivity_state, status,
std::move(picker));
@ -561,7 +560,7 @@ WeightedTargetLb::WeightedChild::CreateChildPolicyLocked(
lb_policy_args.work_serializer = weighted_target_policy_->work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_lb_weighted_target_trace);
@ -770,7 +769,7 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
void RegisterWeightedTargetLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<WeightedTargetLbFactory>());
std::make_unique<WeightedTargetLbFactory>());
}
} // namespace grpc_core

@ -24,7 +24,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -546,7 +545,7 @@ void CdsLb::OnClusterChanged(const std::string& name,
LoadBalancingPolicy::Args args;
args.work_serializer = work_serializer();
args.args = args_;
args.channel_control_helper = absl::make_unique<Helper>(Ref());
args.channel_control_helper = std::make_unique<Helper>(Ref());
child_policy_ =
CoreConfiguration::Get()
.lb_policy_registry()
@ -600,7 +599,7 @@ void CdsLb::OnError(const std::string& name, absl::Status status) {
if (child_policy_ == nullptr) {
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(absl::UnavailableError(
std::make_unique<TransientFailurePicker>(absl::UnavailableError(
absl::StrCat(name, ": ", status.ToString()))));
}
}
@ -614,7 +613,7 @@ void CdsLb::OnResourceDoesNotExist(const std::string& name) {
absl::StrCat("CDS resource \"", config_->cluster(), "\" does not exist"));
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
MaybeDestroyChildPolicyLocked();
}
@ -766,7 +765,7 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
void RegisterCdsLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<CdsLbFactory>());
std::make_unique<CdsLbFactory>());
}
} // namespace grpc_core

@ -23,8 +23,6 @@
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/resolver/server_address.h"
@ -44,7 +42,7 @@ class XdsLocalityAttribute : public ServerAddress::AttributeInterface {
}
std::unique_ptr<AttributeInterface> Copy() const override {
return absl::make_unique<XdsLocalityAttribute>(locality_name_->Ref());
return std::make_unique<XdsLocalityAttribute>(locality_name_->Ref());
}
int Cmp(const AttributeInterface* other) const override {

@ -27,7 +27,6 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -418,7 +417,7 @@ LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick(
}
// Inject subchannel call tracker to record call completion.
complete_pick->subchannel_call_tracker =
absl::make_unique<SubchannelCallTracker>(
std::make_unique<SubchannelCallTracker>(
std::move(complete_pick->subchannel_call_tracker),
std::move(locality_stats),
call_counter_->Ref(DEBUG_LOCATION, "SubchannelCallTracker"));
@ -531,7 +530,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() {
// If we're dropping all calls, report READY, regardless of what (or
// whether) the child has reported.
if (config_->drop_config() != nullptr && config_->drop_config()->drop_all()) {
auto drop_picker = absl::make_unique<Picker>(this, picker_);
auto drop_picker = std::make_unique<Picker>(this, picker_);
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
gpr_log(GPR_INFO,
"[xds_cluster_impl_lb %p] updating connectivity (drop all): "
@ -544,7 +543,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() {
}
// Otherwise, update only if we have a child picker.
if (picker_ != nullptr) {
auto drop_picker = absl::make_unique<Picker>(this, picker_);
auto drop_picker = std::make_unique<Picker>(this, picker_);
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
gpr_log(GPR_INFO,
"[xds_cluster_impl_lb %p] updating connectivity: state=%s "
@ -563,7 +562,7 @@ OrphanablePtr<LoadBalancingPolicy> XdsClusterImplLb::CreateChildPolicyLocked(
lb_policy_args.work_serializer = work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_xds_cluster_impl_lb_trace);
@ -794,7 +793,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
void RegisterXdsClusterImplLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<XdsClusterImplLbFactory>());
std::make_unique<XdsClusterImplLbFactory>());
}
} // namespace grpc_core

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -408,11 +407,11 @@ void XdsClusterManagerLb::UpdateStateLocked() {
}
child_picker = MakeRefCounted<ChildPickerWrapper>(
cluster_name,
absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
std::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
}
}
std::unique_ptr<SubchannelPicker> picker =
absl::make_unique<ClusterPicker>(std::move(cluster_map));
std::make_unique<ClusterPicker>(std::move(cluster_map));
absl::Status status;
if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
status = absl::Status(absl::StatusCode::kUnavailable,
@ -480,7 +479,7 @@ XdsClusterManagerLb::ClusterChild::CreateChildPolicyLocked(
xds_cluster_manager_policy_->work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
&grpc_xds_cluster_manager_lb_trace);
@ -712,7 +711,7 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
void RegisterXdsClusterManagerLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<XdsClusterManagerLbFactory>());
std::make_unique<XdsClusterManagerLbFactory>());
}
} // namespace grpc_core

@ -27,7 +27,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -515,7 +514,7 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
target.c_str(), args, parent()->interested_parties(),
parent()->work_serializer(),
absl::make_unique<ResolverResultHandler>(
std::make_unique<ResolverResultHandler>(
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism")));
if (resolver_ == nullptr) {
parent()->OnResourceDoesNotExist(
@ -840,12 +839,12 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
kHierarchicalPathAttributeKey,
MakeHierarchicalPathAttribute(hierarchical_path))
.WithAttribute(kXdsLocalityNameAttributeKey,
absl::make_unique<XdsLocalityAttribute>(
std::make_unique<XdsLocalityAttribute>(
locality_name->Ref()))
.WithAttribute(
ServerAddressWeightAttribute::
kServerAddressWeightAttributeKey,
absl::make_unique<ServerAddressWeightAttribute>(weight)));
std::make_unique<ServerAddressWeightAttribute>(weight)));
}
}
}
@ -1015,7 +1014,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
"config");
channel_control_helper()->UpdateState(
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
absl::make_unique<TransientFailurePicker>(status));
std::make_unique<TransientFailurePicker>(status));
return nullptr;
}
return std::move(*config);
@ -1052,7 +1051,7 @@ XdsClusterResolverLb::CreateChildPolicyLocked(const ChannelArgs& args) {
lb_policy_args.work_serializer = work_serializer();
lb_policy_args.args = args;
lb_policy_args.channel_control_helper =
absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
std::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
OrphanablePtr<LoadBalancingPolicy> lb_policy =
CoreConfiguration::Get().lb_policy_registry().CreateLoadBalancingPolicy(
"priority_experimental", std::move(lb_policy_args));
@ -1294,7 +1293,7 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
void RegisterXdsClusterResolverLbPolicy(CoreConfiguration::Builder* builder) {
builder->lb_policy_registry()->RegisterLoadBalancingPolicyFactory(
absl::make_unique<XdsClusterResolverLbFactory>());
std::make_unique<XdsClusterResolverLbFactory>());
}
} // namespace grpc_core

@ -30,7 +30,6 @@
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -142,7 +141,7 @@ class BinderResolverFactory : public ResolverFactory {
void RegisterBinderResolver(CoreConfiguration::Builder* builder) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<BinderResolverFactory>());
std::make_unique<BinderResolverFactory>());
}
} // namespace grpc_core

@ -28,7 +28,6 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -832,7 +831,7 @@ bool UseAresDnsResolver() {
void RegisterAresDnsResolver(CoreConfiguration::Builder* builder) {
if (UseAresDnsResolver()) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<AresClientChannelDNSResolverFactory>());
std::make_unique<AresClientChannelDNSResolverFactory>());
}
}
@ -846,8 +845,7 @@ void grpc_resolver_dns_ares_init() {
GRPC_LOG_IF_ERROR("grpc_ares_init() failed", error);
return;
}
grpc_core::ResetDNSResolver(
absl::make_unique<grpc_core::AresDNSResolver>());
grpc_core::ResetDNSResolver(std::make_unique<grpc_core::AresDNSResolver>());
}
}

@ -21,7 +21,6 @@
#include <string>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/closure.h"
@ -108,7 +107,7 @@ class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* /* mu */) {
return absl::make_unique<GrpcPolledFdFactoryPosix>();
return std::make_unique<GrpcPolledFdFactoryPosix>();
}
} // namespace grpc_core

@ -874,7 +874,7 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* mu) {
return absl::make_unique<GrpcPolledFdFactoryWindows>(mu);
return std::make_unique<GrpcPolledFdFactoryWindows>(mu);
}
} // namespace grpc_core

@ -43,7 +43,6 @@
#include <address_sorting/address_sorting.h>
#include <ares.h>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -658,7 +657,7 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
std::unique_ptr<ServerAddressList>* address_list_ptr =
hr->is_balancer ? r->balancer_addresses_out : r->addresses_out;
if (*address_list_ptr == nullptr) {
*address_list_ptr = absl::make_unique<ServerAddressList>();
*address_list_ptr = std::make_unique<ServerAddressList>();
}
ServerAddressList& addresses = **address_list_ptr;
for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) {
@ -920,7 +919,7 @@ static bool inner_resolve_as_ip_literal_locked(
grpc_parse_ipv6_hostport(hostport->c_str(), &addr,
false /* log errors */)) {
GPR_ASSERT(*addrs == nullptr);
*addrs = absl::make_unique<ServerAddressList>();
*addrs = std::make_unique<ServerAddressList>();
(*addrs)->emplace_back(addr.addr, addr.len, grpc_core::ChannelArgs());
return true;
}
@ -978,7 +977,7 @@ static bool inner_maybe_resolve_localhost_manually_locked(
}
if (gpr_stricmp(host->c_str(), "localhost") == 0) {
GPR_ASSERT(*addrs == nullptr);
*addrs = absl::make_unique<grpc_core::ServerAddressList>();
*addrs = std::make_unique<grpc_core::ServerAddressList>();
uint16_t numeric_port = grpc_strhtons(port->c_str());
// Append the ipv6 loopback address.
struct sockaddr_in6 ipv6_loopback_addr;

@ -23,7 +23,6 @@
#include <vector>
#include "absl/functional/bind_front.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -190,12 +189,12 @@ void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder) {
if (gpr_stricmp(resolver, "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<NativeClientChannelDNSResolverFactory>());
std::make_unique<NativeClientChannelDNSResolverFactory>());
} else {
if (!builder->resolver_registry()->HasResolverFactory("dns")) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<NativeClientChannelDNSResolverFactory>());
std::make_unique<NativeClientChannelDNSResolverFactory>());
}
}
}

@ -24,7 +24,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -362,7 +361,7 @@ class FakeResolverFactory : public ResolverFactory {
void RegisterFakeResolver(CoreConfiguration::Builder* builder) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<FakeResolverFactory>());
std::make_unique<FakeResolverFactory>());
}
} // namespace grpc_core

@ -25,7 +25,6 @@
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -453,9 +452,9 @@ class ExperimentalGoogleCloud2ProdResolverFactory : public ResolverFactory {
void RegisterCloud2ProdResolver(CoreConfiguration::Builder* builder) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<GoogleCloud2ProdResolverFactory>());
std::make_unique<GoogleCloud2ProdResolverFactory>());
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<ExperimentalGoogleCloud2ProdResolverFactory>());
std::make_unique<ExperimentalGoogleCloud2ProdResolverFactory>());
}
} // namespace grpc_core

@ -22,7 +22,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
@ -179,14 +178,14 @@ class UnixAbstractResolverFactory : public ResolverFactory {
void RegisterSockaddrResolver(CoreConfiguration::Builder* builder) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<IPv4ResolverFactory>());
std::make_unique<IPv4ResolverFactory>());
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<IPv6ResolverFactory>());
std::make_unique<IPv6ResolverFactory>());
#ifdef GRPC_HAVE_UNIX_SOCKET
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<UnixResolverFactory>());
std::make_unique<UnixResolverFactory>());
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<UnixAbstractResolverFactory>());
std::make_unique<UnixAbstractResolverFactory>());
#endif
}

@ -27,7 +27,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/meta/type_traits.h"
#include "absl/random/random.h"
#include "absl/status/status.h"
@ -1124,7 +1123,7 @@ class XdsResolverFactory : public ResolverFactory {
void RegisterXdsResolver(CoreConfiguration::Builder* builder) {
builder->resolver_registry()->RegisterResolverFactory(
absl::make_unique<XdsResolverFactory>());
std::make_unique<XdsResolverFactory>());
}
} // namespace grpc_core

@ -24,7 +24,6 @@
#include <map>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -50,7 +49,7 @@ size_t ClientChannelServiceConfigParser::ParserIndex() {
void ClientChannelServiceConfigParser::Register(
CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<ClientChannelServiceConfigParser>());
std::make_unique<ClientChannelServiceConfigParser>());
}
namespace {
@ -143,7 +142,7 @@ ClientChannelServiceConfigParser::ParseGlobalParams(const ChannelArgs& /*args*/,
grpc_error_std_string(error)));
return status;
}
return absl::make_unique<ClientChannelGlobalParsedConfig>(
return std::make_unique<ClientChannelGlobalParsedConfig>(
std::move(parsed_lb_config), std::move(lb_policy_name),
std::move(health_check_service_name));
}
@ -178,7 +177,7 @@ ClientChannelServiceConfigParser::ParsePerMethodParams(
grpc_error_std_string(error)));
return status;
}
return absl::make_unique<ClientChannelMethodParsedConfig>(timeout,
return std::make_unique<ClientChannelMethodParsedConfig>(timeout,
wait_for_ready);
}

@ -27,7 +27,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
@ -56,7 +55,7 @@ size_t RetryServiceConfigParser::ParserIndex() {
void RetryServiceConfigParser::Register(CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<RetryServiceConfigParser>());
std::make_unique<RetryServiceConfigParser>());
}
namespace {
@ -156,7 +155,7 @@ RetryServiceConfigParser::ParseGlobalParams(const ChannelArgs& /*args*/,
grpc_error_std_string(error)));
return status;
}
return absl::make_unique<RetryGlobalConfig>(max_milli_tokens,
return std::make_unique<RetryGlobalConfig>(max_milli_tokens,
milli_token_ratio);
}
@ -313,7 +312,7 @@ RetryServiceConfigParser::ParsePerMethodParams(const ChannelArgs& args,
grpc_error_std_string(error)));
return status;
}
return absl::make_unique<RetryMethodConfig>(
return std::make_unique<RetryMethodConfig>(
max_attempts, initial_backoff, max_backoff, backoff_multiplier,
retryable_status_codes, per_attempt_recv_timeout);
}

@ -21,7 +21,6 @@
#include <algorithm>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
@ -168,14 +167,14 @@ FaultInjectionServiceConfigParser::ParsePerMethodParams(const ChannelArgs& args,
return status;
}
if (fault_injection_policies.empty()) return nullptr;
return absl::make_unique<FaultInjectionMethodParsedConfig>(
return std::make_unique<FaultInjectionMethodParsedConfig>(
std::move(fault_injection_policies));
}
void FaultInjectionServiceConfigParser::Register(
CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<FaultInjectionServiceConfigParser>());
std::make_unique<FaultInjectionServiceConfigParser>());
}
size_t FaultInjectionServiceConfigParser::ParserIndex() {

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -121,13 +120,13 @@ MessageSizeParser::ParsePerMethodParams(const ChannelArgs& /*args*/,
grpc_error_std_string(error)));
return status;
}
return absl::make_unique<MessageSizeParsedConfig>(max_request_message_bytes,
return std::make_unique<MessageSizeParsedConfig>(max_request_message_bytes,
max_response_message_bytes);
}
void MessageSizeParser::Register(CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<MessageSizeParser>());
std::make_unique<MessageSizeParser>());
}
size_t MessageSizeParser::ParserIndex() {

@ -23,7 +23,6 @@
#include <map>
#include <string>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -193,7 +192,7 @@ Rbac::Permission ParsePermission(const Json::Object& permission_json,
continue;
}
std::vector<grpc_error_handle> permission_error_list;
permissions.emplace_back(absl::make_unique<Rbac::Permission>(
permissions.emplace_back(std::make_unique<Rbac::Permission>(
ParsePermission(*permission_json, &permission_error_list)));
if (!permission_error_list.empty()) {
error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
@ -329,7 +328,7 @@ Rbac::Principal ParsePrincipal(const Json::Object& principal_json,
continue;
}
std::vector<grpc_error_handle> principal_error_list;
principals.emplace_back(absl::make_unique<Rbac::Principal>(
principals.emplace_back(std::make_unique<Rbac::Principal>(
ParsePrincipal(*principal_json, &principal_error_list)));
if (!principal_error_list.empty()) {
error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
@ -489,7 +488,7 @@ Rbac::Policy ParsePolicy(const Json::Object& policy_json,
continue;
}
std::vector<grpc_error_handle> permission_error_list;
permissions.emplace_back(absl::make_unique<Rbac::Permission>(
permissions.emplace_back(std::make_unique<Rbac::Permission>(
ParsePermission(*permission_json, &permission_error_list)));
if (!permission_error_list.empty()) {
error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
@ -509,7 +508,7 @@ Rbac::Policy ParsePolicy(const Json::Object& policy_json,
continue;
}
std::vector<grpc_error_handle> principal_error_list;
principals.emplace_back(absl::make_unique<Rbac::Principal>(
principals.emplace_back(std::make_unique<Rbac::Principal>(
ParsePrincipal(*principal_json, &principal_error_list)));
if (!principal_error_list.empty()) {
error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
@ -604,12 +603,12 @@ RbacServiceConfigParser::ParsePerMethodParams(const ChannelArgs& args,
return status;
}
if (rbac_policies.empty()) return nullptr;
return absl::make_unique<RbacMethodParsedConfig>(std::move(rbac_policies));
return std::make_unique<RbacMethodParsedConfig>(std::move(rbac_policies));
}
void RbacServiceConfigParser::Register(CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<RbacServiceConfigParser>());
std::make_unique<RbacServiceConfigParser>());
}
size_t RbacServiceConfigParser::ParserIndex() {

@ -21,7 +21,6 @@
#include <utility>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/optional.h"
@ -113,7 +112,7 @@ ServerConfigSelectorFilter::ServerConfigSelectorFilter(
state_(std::make_shared<State>()) {
GPR_ASSERT(server_config_selector_provider_ != nullptr);
auto server_config_selector_watcher =
absl::make_unique<ServerConfigSelectorWatcher>(state_);
std::make_unique<ServerConfigSelectorWatcher>(state_);
auto config_selector = server_config_selector_provider_->Watch(
std::move(server_config_selector_watcher));
MutexLock lock(&state_->mu);

@ -39,7 +39,7 @@ Java_io_grpc_binder_cpp_GrpcBinderConnection_notifyConnected__Ljava_lang_String_
grpc_binder::ndk_util::SpAIBinder aibinder =
grpc_binder::FromJavaBinder(jni_env, ibinder);
gpr_log(GPR_INFO, "%s got aibinder = %p", __func__, aibinder.get());
auto b = absl::make_unique<grpc_binder::BinderAndroid>(aibinder);
auto b = std::make_unique<grpc_binder::BinderAndroid>(aibinder);
GPR_ASSERT(b != nullptr);
grpc_binder::GetEndpointBinderPool()->AddEndpointBinder(conn_id,
std::move(b));

@ -38,7 +38,7 @@ class BinderServerCredentialsImpl final : public ServerCredentials {
return grpc_core::AddBinderPort(
std::string(addr), server,
[](grpc_binder::TransactionReceiver::OnTransactCb transact_cb) {
return absl::make_unique<grpc_binder::TransactionReceiverAndroid>(
return std::make_unique<grpc_binder::TransactionReceiverAndroid>(
nullptr, std::move(transact_cb));
},
security_policy_);

@ -386,7 +386,7 @@ static void perform_stream_op_locked(void* stream_op,
if (!gbs->is_client) {
// Send trailing metadata to inform the other end about the cancellation,
// regardless if we'd already done that or not.
auto cancel_tx = absl::make_unique<grpc_binder::Transaction>(
auto cancel_tx = std::make_unique<grpc_binder::Transaction>(
gbs->GetTxCode(), gbt->is_client);
cancel_tx->SetSuffix(grpc_binder::Metadata{});
cancel_tx->SetStatus(1);
@ -432,8 +432,7 @@ static void perform_stream_op_locked(void* stream_op,
}
int tx_code = gbs->tx_code;
auto tx =
absl::make_unique<grpc_binder::Transaction>(tx_code, gbt->is_client);
auto tx = std::make_unique<grpc_binder::Transaction>(tx_code, gbt->is_client);
if (op->send_initial_metadata) {
gpr_log(GPR_INFO, "send_initial_metadata");

@ -70,7 +70,7 @@ ndk_util::binder_status_t f_onTransact(ndk_util::AIBinder* binder,
TransactionReceiver::OnTransactCb* callback = user_data->callback;
// Wrap the parcel in a ReadableParcel.
std::unique_ptr<ReadableParcel> output =
absl::make_unique<ReadableParcelAndroid>(in);
std::make_unique<ReadableParcelAndroid>(in);
// The lock should be released "after" the callback finishes.
absl::Status status =
(*callback)(code, output.get(), ndk_util::AIBinder_getCallingUid());
@ -217,7 +217,7 @@ absl::Status BinderAndroid::Transact(BinderTransportTxCode tx_code) {
std::unique_ptr<TransactionReceiver> BinderAndroid::ConstructTxReceiver(
grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
TransactionReceiver::OnTransactCb transact_cb) const {
return absl::make_unique<TransactionReceiverAndroid>(wire_reader_ref,
return std::make_unique<TransactionReceiverAndroid>(wire_reader_ref,
transact_cb);
}
@ -282,7 +282,7 @@ absl::Status ReadableParcelAndroid::ReadBinder(std::unique_ptr<Binder>* data) {
*data = nullptr;
return absl::InternalError("AParcel_readStrongBinder failed");
}
*data = absl::make_unique<BinderAndroid>(ndk_util::SpAIBinder(binder));
*data = std::make_unique<BinderAndroid>(ndk_util::SpAIBinder(binder));
return absl::OkStatus();
}

@ -80,7 +80,7 @@ class BinderAndroid final : public Binder {
public:
explicit BinderAndroid(ndk_util::SpAIBinder binder)
: binder_(binder),
input_parcel_(absl::make_unique<WritableParcelAndroid>()) {}
input_parcel_(std::make_unique<WritableParcelAndroid>()) {}
~BinderAndroid() override = default;
void* GetRawBinder() override { return binder_.get(); }

@ -31,7 +31,6 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -766,7 +765,7 @@ Chttp2ServerListener::~Chttp2ServerListener() {
void Chttp2ServerListener::Start(
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
if (server_->config_fetcher() != nullptr) {
auto watcher = absl::make_unique<ConfigFetcherWatcher>(Ref());
auto watcher = std::make_unique<ConfigFetcherWatcher>(Ref());
config_fetcher_watcher_ = watcher.get();
server_->config_fetcher()->StartWatch(
grpc_sockaddr_to_string(&resolved_address_, false).value(),

@ -24,7 +24,6 @@
#include <memory>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
@ -147,7 +146,7 @@ FileWatcherCertificateProviderFactory::CreateCertificateProvider(
void RegisterFileWatcherCertificateProvider(
CoreConfiguration::Builder* builder) {
builder->certificate_provider_registry()->RegisterCertificateProviderFactory(
absl::make_unique<FileWatcherCertificateProviderFactory>());
std::make_unique<FileWatcherCertificateProviderFactory>());
}
} // namespace grpc_core

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
@ -235,7 +234,7 @@ absl::StatusOr<std::unique_ptr<GrpcXdsBootstrap>> GrpcXdsBootstrap::Create(
};
auto bootstrap = LoadFromJson<GrpcXdsBootstrap>(*json, XdsJsonArgs());
if (!bootstrap.ok()) return bootstrap.status();
return absl::make_unique<GrpcXdsBootstrap>(std::move(*bootstrap));
return std::make_unique<GrpcXdsBootstrap>(std::move(*bootstrap));
}
const JsonLoaderInterface* GrpcXdsBootstrap::JsonLoader(const JsonArgs&) {

@ -23,7 +23,6 @@
#include <utility>
#include "absl/functional/bind_front.h"
#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
@ -189,7 +188,7 @@ void XdsCertificateProvider::ClusterCertificateState::
void XdsCertificateProvider::ClusterCertificateState::UpdateRootCertWatcher(
const std::string& cert_name,
grpc_tls_certificate_distributor* root_cert_distributor) {
auto watcher = absl::make_unique<RootCertificatesWatcher>(
auto watcher = std::make_unique<RootCertificatesWatcher>(
xds_certificate_provider_->distributor_, cert_name);
root_cert_watcher_ = watcher.get();
root_cert_distributor->WatchTlsCertificates(std::move(watcher),
@ -199,7 +198,7 @@ void XdsCertificateProvider::ClusterCertificateState::UpdateRootCertWatcher(
void XdsCertificateProvider::ClusterCertificateState::UpdateIdentityCertWatcher(
const std::string& cert_name,
grpc_tls_certificate_distributor* identity_cert_distributor) {
auto watcher = absl::make_unique<IdentityCertificatesWatcher>(
auto watcher = std::make_unique<IdentityCertificatesWatcher>(
xds_certificate_provider_->distributor_, cert_name);
identity_cert_watcher_ = watcher.get();
identity_cert_distributor->WatchTlsCertificates(
@ -288,9 +287,9 @@ void XdsCertificateProvider::UpdateRootCertNameAndDistributor(
MutexLock lock(&mu_);
auto it = certificate_state_map_.find(cert_name);
if (it == certificate_state_map_.end()) {
it = certificate_state_map_
.emplace(cert_name,
absl::make_unique<ClusterCertificateState>(this))
it =
certificate_state_map_
.emplace(cert_name, std::make_unique<ClusterCertificateState>(this))
.first;
}
it->second->UpdateRootCertNameAndDistributor(cert_name, root_cert_name,
@ -313,9 +312,9 @@ void XdsCertificateProvider::UpdateIdentityCertNameAndDistributor(
MutexLock lock(&mu_);
auto it = certificate_state_map_.find(cert_name);
if (it == certificate_state_map_.end()) {
it = certificate_state_map_
.emplace(cert_name,
absl::make_unique<ClusterCertificateState>(this))
it =
certificate_state_map_
.emplace(cert_name, std::make_unique<ClusterCertificateState>(this))
.first;
}
it->second->UpdateIdentityCertNameAndDistributor(
@ -364,9 +363,9 @@ void XdsCertificateProvider::WatchStatusCallback(std::string cert_name,
MutexLock lock(&mu_);
auto it = certificate_state_map_.find(cert_name);
if (it == certificate_state_map_.end()) {
it = certificate_state_map_
.emplace(cert_name,
absl::make_unique<ClusterCertificateState>(this))
it =
certificate_state_map_
.emplace(cert_name, std::make_unique<ClusterCertificateState>(this))
.first;
}
it->second->WatchStatusCallback(cert_name, root_being_watched,

@ -23,7 +23,6 @@
#include <algorithm>
#include "absl/memory/memory.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -880,7 +879,7 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
: "/envoy.service.discovery.v2.AggregatedDiscoveryService/"
"StreamAggregatedResources";
call_ = chand()->transport_->CreateStreamingCall(
method, absl::make_unique<StreamEventHandler>(
method, std::make_unique<StreamEventHandler>(
// Passing the initial ref here. This ref will go away when
// the StreamEventHandler is destroyed.
RefCountedPtr<AdsCallState>(this)));
@ -1269,7 +1268,7 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
: "/envoy.service.load_stats.v2."
"LoadReportingService/StreamLoadStats";
call_ = chand()->transport_->CreateStreamingCall(
method, absl::make_unique<StreamEventHandler>(
method, std::make_unique<StreamEventHandler>(
// Passing the initial ref here. This ref will go away when
// the StreamEventHandler is destroyed.
RefCountedPtr<LrsCallState>(this)));

@ -22,7 +22,6 @@
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -541,7 +540,7 @@ XdsResourceType::DecodeResult XdsClusterResourceType::Decode(
gpr_log(GPR_INFO, "[xds_client %p] parsed Cluster %s: %s", context.client,
result.name->c_str(), cds_resource->ToString().c_str());
}
auto resource = absl::make_unique<ResourceDataSubclass>();
auto resource = std::make_unique<ResourceDataSubclass>();
resource->resource = std::move(*cds_resource);
result.resource = std::move(resource);
}

@ -24,7 +24,6 @@
#include <map>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "upb/json_encode.h"
@ -140,7 +139,7 @@ void XdsClusterSpecifierPluginRegistry::RegisterPlugin(
void XdsClusterSpecifierPluginRegistry::Init() {
g_plugin_registry = new PluginRegistryMap;
RegisterPlugin(absl::make_unique<XdsRouteLookupClusterSpecifierPlugin>(),
RegisterPlugin(std::make_unique<XdsRouteLookupClusterSpecifierPlugin>(),
kXdsRouteLookupClusterSpecifierPluginConfigName);
}

@ -23,7 +23,6 @@
#include <algorithm>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -212,7 +211,7 @@ absl::optional<ServerAddress> ServerAddressParse(
std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
attributes;
attributes[ServerAddressWeightAttribute::kServerAddressWeightAttributeKey] =
absl::make_unique<ServerAddressWeightAttribute>(weight);
std::make_unique<ServerAddressWeightAttribute>(weight);
return ServerAddress(grpc_address, ChannelArgs(), std::move(attributes));
}
@ -424,7 +423,7 @@ XdsResourceType::DecodeResult XdsEndpointResourceType::Decode(
context.client, result.name->c_str(),
eds_resource->ToString().c_str());
}
auto resource = absl::make_unique<ResourceDataSubclass>();
auto resource = std::make_unique<ResourceDataSubclass>();
resource->resource = std::move(*eds_resource);
result.resource = std::move(resource);
}

@ -23,7 +23,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
@ -111,13 +110,13 @@ void XdsHttpFilterRegistry::PopulateSymtab(upb_DefPool* symtab) {
void XdsHttpFilterRegistry::Init() {
g_filters = new FilterOwnerList;
g_filter_registry = new FilterRegistryMap;
RegisterFilter(absl::make_unique<XdsHttpRouterFilter>(),
RegisterFilter(std::make_unique<XdsHttpRouterFilter>(),
{kXdsHttpRouterFilterConfigName});
RegisterFilter(absl::make_unique<XdsHttpFaultFilter>(),
RegisterFilter(std::make_unique<XdsHttpFaultFilter>(),
{kXdsHttpFaultFilterConfigName});
RegisterFilter(absl::make_unique<XdsHttpRbacFilter>(),
RegisterFilter(std::make_unique<XdsHttpRbacFilter>(),
{kXdsHttpRbacFilterConfigName});
RegisterFilter(absl::make_unique<XdsHttpRbacFilter>(),
RegisterFilter(std::make_unique<XdsHttpRbacFilter>(),
{kXdsHttpRbacFilterConfigOverrideName});
}

@ -24,7 +24,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -272,13 +271,13 @@ absl::StatusOr<Json::Array> XdsLbPolicyRegistry::ConvertXdsLbPolicyConfig(
XdsLbPolicyRegistry::XdsLbPolicyRegistry() {
policy_config_factories_.emplace(
RingHashLbPolicyConfigFactory::Type(),
absl::make_unique<RingHashLbPolicyConfigFactory>());
std::make_unique<RingHashLbPolicyConfigFactory>());
policy_config_factories_.emplace(
RoundRobinLbPolicyConfigFactory::Type(),
absl::make_unique<RoundRobinLbPolicyConfigFactory>());
std::make_unique<RoundRobinLbPolicyConfigFactory>());
policy_config_factories_.emplace(
WrrLocalityLbPolicyConfigFactory::Type(),
absl::make_unique<WrrLocalityLbPolicyConfigFactory>());
std::make_unique<WrrLocalityLbPolicyConfigFactory>());
}
XdsLbPolicyRegistry* XdsLbPolicyRegistry::Get() {

@ -23,7 +23,6 @@
#include <set>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -1092,7 +1091,7 @@ XdsResourceType::DecodeResult XdsListenerResourceType::Decode(
context.client, result.name->c_str(),
listener->ToString().c_str());
}
auto resource = absl::make_unique<ResourceDataSubclass>();
auto resource = std::make_unique<ResourceDataSubclass>();
resource->resource = std::move(*listener);
result.resource = std::move(resource);
}

@ -28,7 +28,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -143,7 +142,7 @@ XdsRouteConfigResource::Route::RouteAction::HashPolicy::HashPolicy(
regex_substitution(other.regex_substitution) {
if (other.regex != nullptr) {
regex =
absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
std::make_unique<RE2>(other.regex->pattern(), other.regex->options());
}
}
@ -154,7 +153,7 @@ XdsRouteConfigResource::Route::RouteAction::HashPolicy::operator=(
header_name = other.header_name;
if (other.regex != nullptr) {
regex =
absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
std::make_unique<RE2>(other.regex->pattern(), other.regex->options());
}
regex_substitution = other.regex_substitution;
return *this;
@ -887,7 +886,7 @@ absl::StatusOr<XdsRouteConfigResource::Route::RouteAction> RouteActionParse(
continue;
}
RE2::Options options;
policy.regex = absl::make_unique<RE2>(
policy.regex = std::make_unique<RE2>(
UpbStringToStdString(
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)),
options);
@ -1141,7 +1140,7 @@ XdsResourceType::DecodeResult XdsRouteConfigResourceType::Decode(
context.client, result.name->c_str(),
rds_update->ToString().c_str());
}
auto resource = absl::make_unique<ResourceDataSubclass>();
auto resource = std::make_unique<ResourceDataSubclass>();
resource->resource = std::move(*rds_update);
result.resource = std::move(resource);
}

@ -20,7 +20,6 @@
#include <string>
#include "absl/base/attributes.h"
#include "absl/memory/memory.h"
#include "absl/types/variant.h"
#include <grpc/status.h>
@ -445,7 +444,7 @@ class ClientCallData::PollContext {
};
// Unique ptr --> release to suppress clang-tidy warnings about allocating
// in a destructor.
auto* p = absl::make_unique<NextPoll>().release();
auto* p = std::make_unique<NextPoll>().release();
p->call_stack = self_->call_stack();
p->call_data = self_;
GRPC_CALL_STACK_REF(self_->call_stack(), "re-poll");
@ -912,7 +911,7 @@ class ServerCallData::PollContext {
GRPC_CALL_STACK_UNREF(next_poll->call_stack, "re-poll");
delete next_poll;
};
auto* p = absl::make_unique<NextPoll>().release();
auto* p = std::make_unique<NextPoll>().release();
p->call_stack = self_->call_stack();
p->call_data = self_;
GRPC_CALL_STACK_REF(self_->call_stack(), "re-poll");

@ -18,8 +18,6 @@
#include <memory>
#include "absl/memory/memory.h"
#include <grpc/event_engine/event_engine.h>
#ifdef GPR_WINDOWS
@ -29,7 +27,7 @@ namespace grpc_event_engine {
namespace experimental {
std::unique_ptr<EventEngine> DefaultEventEngineFactory() {
return absl::make_unique<WindowsEventEngine>();
return std::make_unique<WindowsEventEngine>();
}
} // namespace experimental
@ -41,7 +39,7 @@ namespace grpc_event_engine {
namespace experimental {
std::unique_ptr<EventEngine> DefaultEventEngineFactory() {
return absl::make_unique<PosixEventEngine>();
return std::make_unique<PosixEventEngine>();
}
} // namespace experimental

@ -20,7 +20,6 @@
#include <atomic>
#include <memory>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
@ -70,11 +69,10 @@ class Epoll1EventHandle : public EventHandle {
: fd_(fd),
list_(this),
poller_(poller),
read_closure_(absl::make_unique<LockfreeEvent>(poller->GetScheduler())),
write_closure_(
absl::make_unique<LockfreeEvent>(poller->GetScheduler())),
read_closure_(std::make_unique<LockfreeEvent>(poller->GetScheduler())),
write_closure_(std::make_unique<LockfreeEvent>(poller->GetScheduler())),
error_closure_(
absl::make_unique<LockfreeEvent>(poller->GetScheduler())) {
std::make_unique<LockfreeEvent>(poller->GetScheduler())) {
read_closure_->InitEvent();
write_closure_->InitEvent();
error_closure_->InitEvent();

@ -23,7 +23,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/time/time.h"
#include "absl/types/optional.h"
@ -201,7 +200,7 @@ void TimerManager::Run() {
bool TimerManager::IsTimerManagerThread() { return g_timer_thread; }
TimerManager::TimerManager() : host_(this) {
timer_list_ = absl::make_unique<TimerList>(&host_);
timer_list_ = std::make_unique<TimerList>(&host_);
grpc_core::MutexLock lock(&mu_);
StartThread();
}

@ -16,7 +16,6 @@
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -92,7 +91,7 @@ absl::StatusOr<std::unique_ptr<WakeupFd>>
EventFdWakeupFd::CreateEventFdWakeupFd() {
static bool kIsEventFdWakeupFdSupported = EventFdWakeupFd::IsSupported();
if (kIsEventFdWakeupFdSupported) {
auto event_fd_wakeup_fd = absl::make_unique<EventFdWakeupFd>();
auto event_fd_wakeup_fd = std::make_unique<EventFdWakeupFd>();
auto status = event_fd_wakeup_fd->Init();
if (status.ok()) {
return std::unique_ptr<WakeupFd>(std::move(event_fd_wakeup_fd));

@ -17,7 +17,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -120,7 +119,7 @@ bool PipeWakeupFd::IsSupported() {
absl::StatusOr<std::unique_ptr<WakeupFd>> PipeWakeupFd::CreatePipeWakeupFd() {
static bool kIsPipeWakeupFdSupported = PipeWakeupFd::IsSupported();
if (kIsPipeWakeupFdSupported) {
auto pipe_wakeup_fd = absl::make_unique<PipeWakeupFd>();
auto pipe_wakeup_fd = std::make_unique<PipeWakeupFd>();
auto status = pipe_wakeup_fd->Init();
if (status.ok()) {
return std::unique_ptr<WakeupFd>(std::move(pipe_wakeup_fd));

@ -38,8 +38,7 @@ extern grpc_pollset_vtable grpc_posix_pollset_vtable;
extern grpc_pollset_set_vtable grpc_posix_pollset_set_vtable;
static void iomgr_platform_init(void) {
grpc_core::ResetDNSResolver(
absl::make_unique<grpc_core::NativeDNSResolver>());
grpc_core::ResetDNSResolver(std::make_unique<grpc_core::NativeDNSResolver>());
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
grpc_tcp_posix_init();

@ -180,8 +180,7 @@ void grpc_set_default_iomgr_platform() {
}
grpc_tcp_client_global_init();
grpc_set_timer_impl(&grpc_generic_timer_vtable);
grpc_core::ResetDNSResolver(
absl::make_unique<grpc_core::NativeDNSResolver>());
grpc_core::ResetDNSResolver(std::make_unique<grpc_core::NativeDNSResolver>());
}
bool grpc_iomgr_run_in_background() {

@ -61,8 +61,7 @@ static void iomgr_platform_init(void) {
grpc_iocp_init();
grpc_pollset_global_init();
grpc_wsa_socket_flags_init();
grpc_core::ResetDNSResolver(
absl::make_unique<grpc_core::NativeDNSResolver>());
grpc_core::ResetDNSResolver(std::make_unique<grpc_core::NativeDNSResolver>());
}
static void iomgr_platform_flush(void) { grpc_iocp_flush(); }

@ -18,7 +18,6 @@
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/ascii.h"
#include "absl/strings/match.h"
@ -35,7 +34,7 @@ absl::StatusOr<StringMatcher> StringMatcher::Create(Type type,
absl::string_view matcher,
bool case_sensitive) {
if (type == Type::kSafeRegex) {
auto regex_matcher = absl::make_unique<RE2>(std::string(matcher));
auto regex_matcher = std::make_unique<RE2>(std::string(matcher));
if (!regex_matcher->ok()) {
return absl::InvalidArgumentError(
"Invalid regex string specified in matcher.");
@ -56,7 +55,7 @@ StringMatcher::StringMatcher(std::unique_ptr<RE2> regex_matcher)
StringMatcher::StringMatcher(const StringMatcher& other)
: type_(other.type_), case_sensitive_(other.case_sensitive_) {
if (type_ == Type::kSafeRegex) {
regex_matcher_ = absl::make_unique<RE2>(other.regex_matcher_->pattern());
regex_matcher_ = std::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}
@ -65,7 +64,7 @@ StringMatcher::StringMatcher(const StringMatcher& other)
StringMatcher& StringMatcher::operator=(const StringMatcher& other) {
type_ = other.type_;
if (type_ == Type::kSafeRegex) {
regex_matcher_ = absl::make_unique<RE2>(other.regex_matcher_->pattern());
regex_matcher_ = std::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}

@ -29,8 +29,6 @@
#include <string>
#include <vector>
#include "absl/memory/memory.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/resolved_address.h"
@ -127,7 +125,7 @@ class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
uint32_t weight() const { return weight_; }
std::unique_ptr<AttributeInterface> Copy() const override {
return absl::make_unique<ServerAddressWeightAttribute>(weight_);
return std::make_unique<ServerAddressWeightAttribute>(weight_);
}
int Cmp(const AttributeInterface* other) const override {

@ -21,7 +21,6 @@
#include <algorithm>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "absl/types/span.h"
@ -63,7 +62,7 @@ CelAuthorizationEngine::CreateCelAuthorizationEngine(
policy and one allow policy, in that order.");
return nullptr;
} else {
return absl::make_unique<CelAuthorizationEngine>(rbac_policies);
return std::make_unique<CelAuthorizationEngine>(rbac_policies);
}
}

@ -20,8 +20,6 @@
#include <map>
#include <utility>
#include "absl/memory/memory.h"
namespace grpc_core {
GrpcAuthorizationEngine::GrpcAuthorizationEngine(Rbac policy)
@ -29,7 +27,7 @@ GrpcAuthorizationEngine::GrpcAuthorizationEngine(Rbac policy)
for (auto& sub_policy : policy.policies) {
Policy policy;
policy.name = sub_policy.first;
policy.matcher = absl::make_unique<PolicyAuthorizationMatcher>(
policy.matcher = std::make_unique<PolicyAuthorizationMatcher>(
std::move(sub_policy.second));
policies_.push_back(std::move(policy));
}

@ -20,8 +20,6 @@
#include <utility>
#include "absl/memory/memory.h"
#include <grpc/grpc_security.h>
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/slice.h>
@ -123,7 +121,7 @@ FileWatcherAuthorizationPolicyProvider::FileWatcherAuthorizationPolicyProvider(
}
}
};
refresh_thread_ = absl::make_unique<Thread>(
refresh_thread_ = std::make_unique<Thread>(
"FileWatcherAuthorizationPolicyProvider_refreshing_thread", thread_lambda,
WeakRef().release());
refresh_thread_->Start();

@ -21,7 +21,6 @@
#include <algorithm>
#include <string>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -42,35 +41,35 @@ std::unique_ptr<AuthorizationMatcher> AuthorizationMatcher::Create(
for (const auto& rule : permission.permissions) {
matchers.push_back(AuthorizationMatcher::Create(std::move(*rule)));
}
return absl::make_unique<AndAuthorizationMatcher>(std::move(matchers));
return std::make_unique<AndAuthorizationMatcher>(std::move(matchers));
}
case Rbac::Permission::RuleType::kOr: {
std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
for (const auto& rule : permission.permissions) {
matchers.push_back(AuthorizationMatcher::Create(std::move(*rule)));
}
return absl::make_unique<OrAuthorizationMatcher>(std::move(matchers));
return std::make_unique<OrAuthorizationMatcher>(std::move(matchers));
}
case Rbac::Permission::RuleType::kNot:
return absl::make_unique<NotAuthorizationMatcher>(
return std::make_unique<NotAuthorizationMatcher>(
AuthorizationMatcher::Create(std::move(*permission.permissions[0])));
case Rbac::Permission::RuleType::kAny:
return absl::make_unique<AlwaysAuthorizationMatcher>();
return std::make_unique<AlwaysAuthorizationMatcher>();
case Rbac::Permission::RuleType::kHeader:
return absl::make_unique<HeaderAuthorizationMatcher>(
return std::make_unique<HeaderAuthorizationMatcher>(
std::move(permission.header_matcher));
case Rbac::Permission::RuleType::kPath:
return absl::make_unique<PathAuthorizationMatcher>(
return std::make_unique<PathAuthorizationMatcher>(
std::move(permission.string_matcher));
case Rbac::Permission::RuleType::kDestIp:
return absl::make_unique<IpAuthorizationMatcher>(
return std::make_unique<IpAuthorizationMatcher>(
IpAuthorizationMatcher::Type::kDestIp, std::move(permission.ip));
case Rbac::Permission::RuleType::kDestPort:
return absl::make_unique<PortAuthorizationMatcher>(permission.port);
return std::make_unique<PortAuthorizationMatcher>(permission.port);
case Rbac::Permission::RuleType::kMetadata:
return absl::make_unique<MetadataAuthorizationMatcher>(permission.invert);
return std::make_unique<MetadataAuthorizationMatcher>(permission.invert);
case Rbac::Permission::RuleType::kReqServerName:
return absl::make_unique<ReqServerNameAuthorizationMatcher>(
return std::make_unique<ReqServerNameAuthorizationMatcher>(
std::move(permission.string_matcher));
}
return nullptr;
@ -84,41 +83,41 @@ std::unique_ptr<AuthorizationMatcher> AuthorizationMatcher::Create(
for (const auto& id : principal.principals) {
matchers.push_back(AuthorizationMatcher::Create(std::move(*id)));
}
return absl::make_unique<AndAuthorizationMatcher>(std::move(matchers));
return std::make_unique<AndAuthorizationMatcher>(std::move(matchers));
}
case Rbac::Principal::RuleType::kOr: {
std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
for (const auto& id : principal.principals) {
matchers.push_back(AuthorizationMatcher::Create(std::move(*id)));
}
return absl::make_unique<OrAuthorizationMatcher>(std::move(matchers));
return std::make_unique<OrAuthorizationMatcher>(std::move(matchers));
}
case Rbac::Principal::RuleType::kNot:
return absl::make_unique<NotAuthorizationMatcher>(
return std::make_unique<NotAuthorizationMatcher>(
AuthorizationMatcher::Create(std::move(*principal.principals[0])));
case Rbac::Principal::RuleType::kAny:
return absl::make_unique<AlwaysAuthorizationMatcher>();
return std::make_unique<AlwaysAuthorizationMatcher>();
case Rbac::Principal::RuleType::kPrincipalName:
return absl::make_unique<AuthenticatedAuthorizationMatcher>(
return std::make_unique<AuthenticatedAuthorizationMatcher>(
std::move(principal.string_matcher));
case Rbac::Principal::RuleType::kSourceIp:
return absl::make_unique<IpAuthorizationMatcher>(
return std::make_unique<IpAuthorizationMatcher>(
IpAuthorizationMatcher::Type::kSourceIp, std::move(principal.ip));
case Rbac::Principal::RuleType::kDirectRemoteIp:
return absl::make_unique<IpAuthorizationMatcher>(
return std::make_unique<IpAuthorizationMatcher>(
IpAuthorizationMatcher::Type::kDirectRemoteIp,
std::move(principal.ip));
case Rbac::Principal::RuleType::kRemoteIp:
return absl::make_unique<IpAuthorizationMatcher>(
return std::make_unique<IpAuthorizationMatcher>(
IpAuthorizationMatcher::Type::kRemoteIp, std::move(principal.ip));
case Rbac::Principal::RuleType::kHeader:
return absl::make_unique<HeaderAuthorizationMatcher>(
return std::make_unique<HeaderAuthorizationMatcher>(
std::move(principal.header_matcher));
case Rbac::Principal::RuleType::kPath:
return absl::make_unique<PathAuthorizationMatcher>(
return std::make_unique<PathAuthorizationMatcher>(
std::move(principal.string_matcher.value()));
case Rbac::Principal::RuleType::kMetadata:
return absl::make_unique<MetadataAuthorizationMatcher>(principal.invert);
return std::make_unique<MetadataAuthorizationMatcher>(principal.invert);
}
return nullptr;
}

@ -19,8 +19,6 @@
#include <memory>
#include "absl/memory/memory.h"
#include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
#include "src/core/lib/security/authorization/mock_cel/flat_expr_builder.h"
@ -36,7 +34,7 @@ struct InterpreterOptions {
inline std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
const InterpreterOptions& options) {
return absl::make_unique<FlatExprBuilder>();
return std::make_unique<FlatExprBuilder>();
}
} // namespace mock_cel

@ -38,7 +38,6 @@
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
@ -93,7 +92,7 @@ class ContainerBackedMapImpl : public CelMap {
static std::unique_ptr<CelMap> Create(
absl::Span<std::pair<CelValue, CelValue>> /*key_values*/) {
return absl::make_unique<ContainerBackedMapImpl>();
return std::make_unique<ContainerBackedMapImpl>();
}
};

@ -22,7 +22,6 @@
#include <string>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
@ -46,7 +45,7 @@ class FlatExprBuilder : public CelExpressionBuilder {
const google_api_expr_v1alpha1_Expr* expr,
const google_api_expr_v1alpha1_SourceInfo* source_info) const override {
ExecutionPath path;
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
return std::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
std::set<std::string>{});
}
@ -55,7 +54,7 @@ class FlatExprBuilder : public CelExpressionBuilder {
const google_api_expr_v1alpha1_SourceInfo* source_info,
std::vector<absl::Status>* warnings) const override {
ExecutionPath path;
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
return std::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
std::set<std::string>{});
}
};

@ -19,7 +19,6 @@
#include <algorithm>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
@ -99,7 +98,7 @@ Rbac::Permission Rbac::Permission::MakeNotPermission(Permission permission) {
Permission not_permission;
not_permission.type = Permission::RuleType::kNot;
not_permission.permissions.push_back(
absl::make_unique<Rbac::Permission>(std::move(permission)));
std::make_unique<Rbac::Permission>(std::move(permission)));
return not_permission;
}
@ -271,7 +270,7 @@ Rbac::Principal Rbac::Principal::MakeNotPrincipal(Principal principal) {
Principal not_principal;
not_principal.type = Principal::RuleType::kNot;
not_principal.principals.push_back(
absl::make_unique<Rbac::Principal>(std::move(principal)));
std::make_unique<Rbac::Principal>(std::move(principal)));
return not_principal;
}

@ -25,7 +25,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
@ -103,7 +102,7 @@ absl::StatusOr<Rbac::Principal> ParsePrincipalsArray(const Json& json) {
absl::StrCat("\"principals\" ", i, ": ",
matcher_or.status().message()));
}
principal_names.push_back(absl::make_unique<Rbac::Principal>(
principal_names.push_back(std::make_unique<Rbac::Principal>(
Rbac::Principal::MakeAuthenticatedPrincipal(
std::move(matcher_or.value()))));
}
@ -120,7 +119,7 @@ absl::StatusOr<Rbac::Principal> ParsePeer(const Json& json) {
auto principal_names_or = ParsePrincipalsArray(it->second);
if (!principal_names_or.ok()) return principal_names_or.status();
if (!principal_names_or.value().principals.empty()) {
peer.push_back(absl::make_unique<Rbac::Principal>(
peer.push_back(std::make_unique<Rbac::Principal>(
std::move(principal_names_or.value())));
}
}
@ -148,7 +147,7 @@ absl::StatusOr<Rbac::Permission> ParseHeaderValues(
matcher_or.status().code(),
absl::StrCat("\"values\" ", i, ": ", matcher_or.status().message()));
}
values.push_back(absl::make_unique<Rbac::Permission>(
values.push_back(std::make_unique<Rbac::Permission>(
Rbac::Permission::MakeHeaderPermission(std::move(matcher_or.value()))));
}
return Rbac::Permission::MakeOrPermission(std::move(values));
@ -194,7 +193,7 @@ absl::StatusOr<Rbac::Permission> ParseHeadersArray(const Json& json) {
absl::StrCat("\"headers\" ", i, ": ", headers_or.status().message()));
}
headers.push_back(
absl::make_unique<Rbac::Permission>(std::move(headers_or.value())));
std::make_unique<Rbac::Permission>(std::move(headers_or.value())));
}
return Rbac::Permission::MakeAndPermission(std::move(headers));
}
@ -213,7 +212,7 @@ absl::StatusOr<Rbac::Permission> ParsePathsArray(const Json& json) {
matcher_or.status().code(),
absl::StrCat("\"paths\" ", i, ": ", matcher_or.status().message()));
}
paths.push_back(absl::make_unique<Rbac::Permission>(
paths.push_back(std::make_unique<Rbac::Permission>(
Rbac::Permission::MakePathPermission(std::move(matcher_or.value()))));
}
return Rbac::Permission::MakeOrPermission(std::move(paths));
@ -230,7 +229,7 @@ absl::StatusOr<Rbac::Permission> ParseRequest(const Json& json) {
if (!paths_or.ok()) return paths_or.status();
if (!paths_or.value().permissions.empty()) {
request.push_back(
absl::make_unique<Rbac::Permission>(std::move(paths_or.value())));
std::make_unique<Rbac::Permission>(std::move(paths_or.value())));
}
}
it = json.object_value().find("headers");
@ -242,7 +241,7 @@ absl::StatusOr<Rbac::Permission> ParseRequest(const Json& json) {
if (!headers_or.ok()) return headers_or.status();
if (!headers_or.value().permissions.empty()) {
request.push_back(
absl::make_unique<Rbac::Permission>(std::move(headers_or.value())));
std::make_unique<Rbac::Permission>(std::move(headers_or.value())));
}
}
if (request.empty()) {

@ -20,7 +20,6 @@
#include <memory>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
@ -71,11 +70,11 @@ class FakeChannelCredsFactory : public ChannelCredsFactory<> {
void RegisterChannelDefaultCreds(CoreConfiguration::Builder* builder) {
builder->channel_creds_registry()->RegisterChannelCredsFactory(
absl::make_unique<GoogleDefaultChannelCredsFactory>());
std::make_unique<GoogleDefaultChannelCredsFactory>());
builder->channel_creds_registry()->RegisterChannelCredsFactory(
absl::make_unique<InsecureChannelCredsFactory>());
std::make_unique<InsecureChannelCredsFactory>());
builder->channel_creds_registry()->RegisterChannelCredsFactory(
absl::make_unique<FakeChannelCredsFactory>());
std::make_unique<FakeChannelCredsFactory>());
}
} // namespace grpc_core

@ -22,7 +22,6 @@
#include <map>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -465,7 +464,7 @@ void AwsExternalAccountCredentials::BuildSubjectToken() {
if (signer_ == nullptr) {
cred_verification_url_ = absl::StrReplaceAll(
regional_cred_verification_url_, {{"{region}", region_}});
signer_ = absl::make_unique<AwsRequestSigner>(
signer_ = std::make_unique<AwsRequestSigner>(
access_key_id_, secret_access_key_, token_, "POST",
cred_verification_url_, region_, "",
std::map<std::string, std::string>(), &error);

@ -28,7 +28,6 @@
#include <vector>
#include "absl/functional/bind_front.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -285,7 +284,7 @@ TlsChannelSecurityConnector::TlsChannelSecurityConnector(
SplitHostPort(target_name, &host, &port);
target_name_ = std::string(host);
// Create a watcher.
auto watcher_ptr = absl::make_unique<TlsChannelCertificateWatcher>(this);
auto watcher_ptr = std::make_unique<TlsChannelCertificateWatcher>(this);
certificate_watcher_ = watcher_ptr.get();
// Register the watcher with the distributor.
grpc_tls_certificate_distributor* distributor =
@ -587,7 +586,7 @@ TlsServerSecurityConnector::TlsServerSecurityConnector(
tsi::TlsSessionKeyLoggerCache::Get(tls_session_key_log_file_path);
}
// Create a watcher.
auto watcher_ptr = absl::make_unique<TlsServerCertificateWatcher>(this);
auto watcher_ptr = std::make_unique<TlsServerCertificateWatcher>(this);
certificate_watcher_ = watcher_ptr.get();
// Register the watcher with the distributor.
grpc_tls_certificate_distributor* distributor =

@ -29,7 +29,6 @@
#include <string>
#include "absl/base/attributes.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -656,10 +655,10 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
void SecurityRegisterHandshakerFactories(CoreConfiguration::Builder* builder) {
builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_CLIENT,
absl::make_unique<ClientSecurityHandshakerFactory>());
std::make_unique<ClientSecurityHandshakerFactory>());
builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_SERVER,
absl::make_unique<ServerSecurityHandshakerFactory>());
std::make_unique<ServerSecurityHandshakerFactory>());
}
} // namespace grpc_core

@ -24,7 +24,6 @@
#include <string>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -97,7 +96,7 @@ absl::Status ServiceConfigImpl::ParseJsonMethodConfig(const ChannelArgs& args,
errors.emplace_back(parsed_configs_or.status().message());
} else {
auto parsed_configs =
absl::make_unique<ServiceConfigParser::ParsedConfigVector>(
std::make_unique<ServiceConfigParser::ParsedConfigVector>(
std::move(*parsed_configs_or));
parsed_method_config_vectors_storage_.push_back(std::move(parsed_configs));
vector_ptr = parsed_method_config_vectors_storage_.back().get();

@ -23,7 +23,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/status/statusor.h"
#include <grpc/grpc.h>
@ -67,7 +66,7 @@ absl::StatusOr<LameClientFilter> LameClientFilter::Create(
}
LameClientFilter::LameClientFilter(absl::Status error)
: error_(std::move(error)), state_(absl::make_unique<State>()) {}
: error_(std::move(error)), state_(std::make_unique<State>()) {}
LameClientFilter::State::State()
: state_tracker("lame_client", GRPC_CHANNEL_SHUTDOWN) {}

@ -30,7 +30,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"
@ -562,11 +561,11 @@ void Server::Start() {
}
}
if (unregistered_request_matcher_ == nullptr) {
unregistered_request_matcher_ = absl::make_unique<RealRequestMatcher>(this);
unregistered_request_matcher_ = std::make_unique<RealRequestMatcher>(this);
}
for (std::unique_ptr<RegisteredMethod>& rm : registered_methods_) {
if (rm->matcher == nullptr) {
rm->matcher = absl::make_unique<RealRequestMatcher>(this);
rm->matcher = std::make_unique<RealRequestMatcher>(this);
}
}
{
@ -633,7 +632,7 @@ void Server::SetRegisteredMethodAllocator(
grpc_completion_queue* cq, void* method_tag,
std::function<RegisteredCallAllocation()> allocator) {
RegisteredMethod* rm = static_cast<RegisteredMethod*>(method_tag);
rm->matcher = absl::make_unique<AllocatingRequestMatcherRegistered>(
rm->matcher = std::make_unique<AllocatingRequestMatcherRegistered>(
this, cq, rm, std::move(allocator));
}
@ -641,7 +640,7 @@ void Server::SetBatchMethodAllocator(
grpc_completion_queue* cq, std::function<BatchCallAllocation()> allocator) {
GPR_DEBUG_ASSERT(unregistered_request_matcher_ == nullptr);
unregistered_request_matcher_ =
absl::make_unique<AllocatingRequestMatcherBatch>(this, cq,
std::make_unique<AllocatingRequestMatcherBatch>(this, cq,
std::move(allocator));
}
@ -683,7 +682,7 @@ Server::RegisteredMethod* Server::RegisterMethod(
flags);
return nullptr;
}
registered_methods_.emplace_back(absl::make_unique<RegisteredMethod>(
registered_methods_.emplace_back(std::make_unique<RegisteredMethod>(
method, host, payload_handling, flags));
return registered_methods_.back().get();
}
@ -1015,7 +1014,7 @@ void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
uint32_t max_probes = 0;
size_t slots = 2 * num_registered_methods;
registered_methods_ =
absl::make_unique<std::vector<ChannelRegisteredMethod>>(slots);
std::make_unique<std::vector<ChannelRegisteredMethod>>(slots);
for (std::unique_ptr<RegisteredMethod>& rm : server_->registered_methods_) {
Slice host;
Slice method = Slice::FromExternalString(rm->method);

@ -31,7 +31,6 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/statusor.h"
#include "absl/types/optional.h"
@ -426,7 +425,7 @@ class Server : public InternallyRefCounted<Server>,
MaybeFinishShutdown();
return nullptr;
}
requests_complete_ = absl::make_unique<Notification>();
requests_complete_ = std::make_unique<Notification>();
return requests_complete_.get();
}

@ -27,7 +27,6 @@
#include <string>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -394,7 +393,7 @@ class HttpConnectHandshakerFactory : public HandshakerFactory {
void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) {
builder->handshaker_registry()->RegisterHandshakerFactory(
true /* at_start */, HANDSHAKER_CLIENT,
absl::make_unique<HttpConnectHandshakerFactory>());
std::make_unique<HttpConnectHandshakerFactory>());
}
} // namespace grpc_core

@ -23,7 +23,6 @@
#include <memory>
#include "absl/base/thread_annotations.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -241,7 +240,7 @@ class TCPConnectHandshakerFactory : public HandshakerFactory {
void RegisterTCPConnectHandshaker(CoreConfiguration::Builder* builder) {
builder->handshaker_registry()->RegisterHandshakerFactory(
true /* at_start */, HANDSHAKER_CLIENT,
absl::make_unique<TCPConnectHandshakerFactory>());
std::make_unique<TCPConnectHandshakerFactory>());
}
} // namespace grpc_core

@ -51,7 +51,7 @@ class BoringSslCachedSession : public SslCachedSession {
std::unique_ptr<SslCachedSession> SslCachedSession::Create(
SslSessionPtr session) {
return absl::make_unique<BoringSslCachedSession>(std::move(session));
return std::make_unique<BoringSslCachedSession>(std::move(session));
}
} // namespace tsi

@ -73,7 +73,7 @@ class OpenSslCachedSession : public SslCachedSession {
std::unique_ptr<SslCachedSession> SslCachedSession::Create(
SslSessionPtr session) {
return absl::make_unique<OpenSslCachedSession>(std::move(session));
return std::make_unique<OpenSslCachedSession>(std::move(session));
}
} // namespace tsi

@ -21,7 +21,6 @@
#include <string>
#include <vector>
#include "absl/memory/memory.h"
#include "upb/upb.hpp"
#include <grpc/grpc_security_constants.h>
@ -63,7 +62,7 @@ std::unique_ptr<AltsContext> GetAltsContextFromAuthContext(
gpr_log(GPR_ERROR, "security_level is invalid.");
return nullptr;
}
return absl::make_unique<AltsContext>(AltsContext(ctx));
return std::make_unique<AltsContext>(AltsContext(ctx));
}
grpc::Status AltsClientAuthzCheck(

@ -23,7 +23,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "upb/upb.h"
#include "upb/upb.hpp"
@ -111,7 +110,7 @@ void DefaultHealthCheckService::UnregisterWatch(
DefaultHealthCheckService::HealthCheckServiceImpl*
DefaultHealthCheckService::GetHealthCheckService() {
GPR_ASSERT(impl_ == nullptr);
impl_ = absl::make_unique<HealthCheckServiceImpl>(this);
impl_ = std::make_unique<HealthCheckServiceImpl>(this);
return impl_.get();
}

@ -25,8 +25,6 @@
#include <google/protobuf/duration.pb.h>
#include <google/protobuf/repeated_ptr_field.h>
#include "absl/memory/memory.h"
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/support/time.h>
#include <grpcpp/support/status.h>
@ -46,12 +44,12 @@ LoadReporterAsyncServiceImpl::LoadReporterAsyncServiceImpl(
std::unique_ptr<ServerCompletionQueue> cq)
: cq_(std::move(cq)) {
thread_ =
absl::make_unique<grpc_core::Thread>("server_load_reporting", Work, this);
std::make_unique<grpc_core::Thread>("server_load_reporting", Work, this);
std::unique_ptr<CpuStatsProvider> cpu_stats_provider = nullptr;
#if defined(GPR_LINUX) || defined(GPR_WINDOWS) || defined(GPR_APPLE)
cpu_stats_provider = absl::make_unique<CpuStatsProviderDefaultImpl>();
cpu_stats_provider = std::make_unique<CpuStatsProviderDefaultImpl>();
#endif
load_reporter_ = absl::make_unique<LoadReporter>(
load_reporter_ = std::make_unique<LoadReporter>(
kFeedbackSampleWindowSeconds,
std::unique_ptr<CensusViewProvider>(new CensusViewProviderDefaultImpl()),
std::move(cpu_stats_provider));
@ -80,7 +78,7 @@ void LoadReporterAsyncServiceImpl::ScheduleNextFetchAndSample() {
if (shutdown_) return;
// TODO(juanlishen): Improve the Alarm implementation to reuse a single
// instance for multiple events.
next_fetch_and_sample_alarm_ = absl::make_unique<Alarm>();
next_fetch_and_sample_alarm_ = std::make_unique<Alarm>();
next_fetch_and_sample_alarm_->Set(cq_.get(), next_fetch_and_sample_time,
this);
}
@ -280,7 +278,7 @@ void LoadReporterAsyncServiceImpl::ReportLoadHandler::ScheduleNextReport(
std::move(self));
// TODO(juanlishen): Improve the Alarm implementation to reuse a single
// instance for multiple events.
next_report_alarm_ = absl::make_unique<Alarm>();
next_report_alarm_ = std::make_unique<Alarm>();
next_report_alarm_->Set(cq_, next_report_time, &next_outbound_);
}
gpr_log(GPR_DEBUG,

@ -23,7 +23,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
@ -67,7 +66,7 @@ Interceptor* OrcaServerInterceptorFactory::CreateServerInterceptor(
void OrcaServerInterceptorFactory::Register(grpc::ServerBuilder* builder) {
builder->internal_interceptor_creators_.push_back(
absl::make_unique<OrcaServerInterceptorFactory>());
std::make_unique<OrcaServerInterceptorFactory>());
}
void EnableCallMetricRecording(grpc::ServerBuilder* builder) {

@ -28,7 +28,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include <grpc/byte_buffer.h>
@ -827,7 +826,7 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
void AddUnknownSyncMethod() {
if (has_sync_method_) {
unknown_method_ = absl::make_unique<grpc::internal::RpcServiceMethod>(
unknown_method_ = std::make_unique<grpc::internal::RpcServiceMethod>(
"unknown", grpc::internal::RpcMethod::BIDI_STREAMING,
new grpc::internal::UnknownMethodHandler(kUnknownRpcMethod));
grpc_core::Server::FromC(server_->server())
@ -1149,7 +1148,7 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
// explicit one.
if (health_check_service_ == nullptr && !health_check_service_disabled_ &&
grpc::DefaultHealthCheckServiceEnabled()) {
auto default_hc_service = absl::make_unique<DefaultHealthCheckService>();
auto default_hc_service = std::make_unique<DefaultHealthCheckService>();
auto* hc_service_impl = default_hc_service->GetHealthCheckService();
health_check_service_ = std::move(default_hc_service);
RegisterService(nullptr, hc_service_impl);
@ -1182,7 +1181,7 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
bool unknown_rpc_needed =
!has_async_generic_service_ && !has_callback_generic_service_;
if (unknown_rpc_needed && has_callback_methods_) {
unimplemented_service_ = absl::make_unique<grpc::CallbackGenericService>();
unimplemented_service_ = std::make_unique<grpc::CallbackGenericService>();
RegisterCallbackGenericService(unimplemented_service_.get());
unknown_rpc_needed = false;
}
@ -1207,7 +1206,7 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
// to deal with the case of thread exhaustion
if (sync_server_cqs_ != nullptr && !sync_server_cqs_->empty()) {
resource_exhausted_handler_ =
absl::make_unique<grpc::internal::ResourceExhaustedHandler>(
std::make_unique<grpc::internal::ResourceExhaustedHandler>(
kServerThreadpoolExhausted);
}

@ -465,8 +465,8 @@ TEST_F(ChannelzRegistryBasedTest, GetTopChannelsUuidAfterCompaction) {
// these will delete and unregister themselves after this block.
std::vector<std::unique_ptr<ChannelFixture>> odd_channels;
for (int i = 0; i < kLoopIterations; i++) {
odd_channels.push_back(absl::make_unique<ChannelFixture>());
even_channels.push_back(absl::make_unique<ChannelFixture>());
odd_channels.push_back(std::make_unique<ChannelFixture>());
even_channels.push_back(std::make_unique<ChannelFixture>());
}
}
std::string json_str = ChannelzRegistry::GetTopChannels(0);

@ -112,7 +112,7 @@ class BinderResolverTest : public ::testing::Test {
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.result_handler =
absl::make_unique<BinderResolverTest::ResultHandler>(expected_path);
std::make_unique<BinderResolverTest::ResultHandler>(expected_path);
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory_->CreateResolver(std::move(args));
ASSERT_TRUE(resolver != nullptr);
@ -127,8 +127,7 @@ class BinderResolverTest : public ::testing::Test {
ASSERT_TRUE(uri.ok()) << uri.status().ToString();
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.result_handler =
absl::make_unique<BinderResolverTest::ResultHandler>();
args.result_handler = std::make_unique<BinderResolverTest::ResultHandler>();
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory_->CreateResolver(std::move(args));
EXPECT_TRUE(resolver == nullptr);

@ -391,7 +391,7 @@ TEST(DnsResolverCooldownTest, MainTest) {
g_default_dns_lookup_ares = grpc_dns_lookup_hostname_ares;
grpc_dns_lookup_hostname_ares = test_dns_lookup_ares;
grpc_core::ResetDNSResolver(
absl::make_unique<TestDNSResolver>(grpc_core::GetDNSResolver()));
std::make_unique<TestDNSResolver>(grpc_core::GetDNSResolver()));
test_cooldown();

@ -52,7 +52,7 @@ static void test_succeeds(grpc_core::ResolverFactory* factory,
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.work_serializer = *g_work_serializer;
args.result_handler = absl::make_unique<TestResultHandler>();
args.result_handler = std::make_unique<TestResultHandler>();
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory->CreateResolver(std::move(args));
ASSERT_NE(resolver, nullptr);
@ -71,7 +71,7 @@ static void test_fails(grpc_core::ResolverFactory* factory,
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.work_serializer = *g_work_serializer;
args.result_handler = absl::make_unique<TestResultHandler>();
args.result_handler = std::make_unique<TestResultHandler>();
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory->CreateResolver(std::move(args));
ASSERT_EQ(resolver, nullptr);

@ -52,7 +52,7 @@ static void test_succeeds(grpc_core::ResolverFactory* factory,
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.work_serializer = *g_work_serializer;
args.result_handler = absl::make_unique<ResultHandler>();
args.result_handler = std::make_unique<ResultHandler>();
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory->CreateResolver(std::move(args));
ASSERT_NE(resolver, nullptr);
@ -75,7 +75,7 @@ static void test_fails(grpc_core::ResolverFactory* factory,
grpc_core::ResolverArgs args;
args.uri = std::move(*uri);
args.work_serializer = *g_work_serializer;
args.result_handler = absl::make_unique<ResultHandler>();
args.result_handler = std::make_unique<ResultHandler>();
grpc_core::OrphanablePtr<grpc_core::Resolver> resolver =
factory->CreateResolver(std::move(args));
ASSERT_EQ(resolver, nullptr);

@ -77,7 +77,7 @@ class TestParser1 : public ServiceConfigParser::Parser {
if (value == -1) {
return absl::InvalidArgumentError(InvalidValueErrorMessage());
}
return absl::make_unique<TestParsedConfig1>(value);
return std::make_unique<TestParsedConfig1>(value);
}
return nullptr;
}
@ -109,7 +109,7 @@ class TestParser2 : public ServiceConfigParser::Parser {
if (value == -1) {
return absl::InvalidArgumentError(InvalidValueErrorMessage());
}
return absl::make_unique<TestParsedConfig1>(value);
return std::make_unique<TestParsedConfig1>(value);
}
return nullptr;
}
@ -155,9 +155,9 @@ class ServiceConfigTest : public ::testing::Test {
builder_ = std::make_unique<CoreConfiguration::WithSubstituteBuilder>(
[](CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<TestParser1>());
std::make_unique<TestParser1>());
builder->service_config_parser()->RegisterParser(
absl::make_unique<TestParser2>());
std::make_unique<TestParser2>());
});
EXPECT_EQ(CoreConfiguration::Get().service_config_parser().GetParserIndex(
"test_parser_1"),
@ -411,9 +411,9 @@ TEST(ServiceConfigParserTest, DoubleRegistration) {
CoreConfiguration::WithSubstituteBuilder builder(
[](CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<ErrorParser>("xyzabc"));
std::make_unique<ErrorParser>("xyzabc"));
builder->service_config_parser()->RegisterParser(
absl::make_unique<ErrorParser>("xyzabc"));
std::make_unique<ErrorParser>("xyzabc"));
}),
"xyzabc.*already registered");
}
@ -425,9 +425,9 @@ class ErroredParsersScopingTest : public ::testing::Test {
builder_ = std::make_unique<CoreConfiguration::WithSubstituteBuilder>(
[](CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<ErrorParser>("ep1"));
std::make_unique<ErrorParser>("ep1"));
builder->service_config_parser()->RegisterParser(
absl::make_unique<ErrorParser>("ep2"));
std::make_unique<ErrorParser>("ep2"));
});
EXPECT_EQ(
CoreConfiguration::Get().service_config_parser().GetParserIndex("ep1"),
@ -755,7 +755,7 @@ class RetryParserTest : public ::testing::Test {
builder_ = std::make_unique<CoreConfiguration::WithSubstituteBuilder>(
[](CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<internal::RetryServiceConfigParser>());
std::make_unique<internal::RetryServiceConfigParser>());
});
EXPECT_EQ(CoreConfiguration::Get().service_config_parser().GetParserIndex(
"retry"),
@ -1449,7 +1449,7 @@ class MessageSizeParserTest : public ::testing::Test {
builder_ = std::make_unique<CoreConfiguration::WithSubstituteBuilder>(
[](CoreConfiguration::Builder* builder) {
builder->service_config_parser()->RegisterParser(
absl::make_unique<MessageSizeParser>());
std::make_unique<MessageSizeParser>());
});
EXPECT_EQ(CoreConfiguration::Get().service_config_parser().GetParserIndex(
"message_size"),

@ -160,7 +160,6 @@ grpc_cc_test(
name = "goaway_server_test",
srcs = ["goaway_server_test.cc"],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -202,7 +201,6 @@ grpc_cc_test(
grpc_cc_test(
name = "invalid_call_argument_test",
srcs = ["invalid_call_argument_test.cc"],
external_deps = ["absl/memory"],
language = "C++",
deps = [
"cq_verifier",

@ -29,7 +29,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
@ -119,7 +118,7 @@ static void finish_resolve(void* arg, grpc_error_handle error) {
addr_req* r = static_cast<addr_req*>(arg);
if (error.ok() && 0 == strcmp(r->addr, "server")) {
*r->addresses = absl::make_unique<grpc_core::ServerAddressList>();
*r->addresses = std::make_unique<grpc_core::ServerAddressList>();
grpc_resolved_address fake_resolved_address;
GPR_ASSERT(
grpc_parse_ipv4_hostport("1.2.3.4:5", &fake_resolved_address, false));
@ -823,7 +822,7 @@ DEFINE_PROTO_FUZZER(const api_fuzzer::Msg& msg) {
grpc_event_engine::experimental::SetEventEngineFactory(
[actions = msg.event_engine_actions()]() {
return absl::make_unique<FuzzingEventEngine>(
return std::make_unique<FuzzingEventEngine>(
FuzzingEventEngine::Options(), actions);
});
auto engine =
@ -836,7 +835,7 @@ DEFINE_PROTO_FUZZER(const api_fuzzer::Msg& msg) {
grpc_core::Executor::SetThreadingAll(false);
}
grpc_core::ResetDNSResolver(
absl::make_unique<FuzzerDNSResolver>(engine.get()));
std::make_unique<FuzzerDNSResolver>(engine.get()));
grpc_dns_lookup_hostname_ares = my_dns_lookup_ares;
grpc_cancel_ares_request = my_cancel_ares_request;

@ -26,7 +26,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -187,7 +186,7 @@ static grpc_ares_request* my_dns_lookup_ares(
gpr_mu_unlock(&g_mu);
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Failure");
} else {
*addresses = absl::make_unique<grpc_core::ServerAddressList>();
*addresses = std::make_unique<grpc_core::ServerAddressList>();
grpc_sockaddr_in sa;
memset(&sa, 0, sizeof(sa));
sa.sin_family = GRPC_AF_INET;
@ -216,7 +215,7 @@ int main(int argc, char** argv) {
gpr_mu_init(&g_mu);
grpc_init();
grpc_core::ResetDNSResolver(
absl::make_unique<TestDNSResolver>(grpc_core::GetDNSResolver()));
std::make_unique<TestDNSResolver>(grpc_core::GetDNSResolver()));
iomgr_dns_lookup_ares = grpc_dns_lookup_hostname_ares;
iomgr_cancel_ares_request = grpc_cancel_ares_request;
grpc_dns_lookup_hostname_ares = my_dns_lookup_ares;

@ -26,8 +26,6 @@
#include <memory>
#include <string>
#include "absl/memory/memory.h"
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@ -72,7 +70,7 @@ static void prepare_test(int is_client) {
grpc_metadata_array_init(&g_state.trailing_metadata_recv);
g_state.deadline = grpc_timeout_seconds_to_deadline(5);
g_state.cq = grpc_completion_queue_create_for_next(nullptr);
g_state.cqv = absl::make_unique<grpc_core::CqVerifier>(g_state.cq);
g_state.cqv = std::make_unique<grpc_core::CqVerifier>(g_state.cq);
g_state.details = grpc_empty_slice();
memset(g_state.ops, 0, sizeof(g_state.ops));

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

Loading…
Cancel
Save