grpc 1.25.0 → 1.26.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (278) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +782 -291
  3. data/include/grpc/impl/codegen/grpc_types.h +4 -0
  4. data/include/grpc/impl/codegen/port_platform.h +7 -0
  5. data/include/grpc/support/alloc.h +0 -16
  6. data/src/core/ext/filters/client_channel/backend_metric.cc +2 -2
  7. data/src/core/ext/filters/client_channel/backup_poller.cc +1 -1
  8. data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -2
  9. data/src/core/ext/filters/client_channel/client_channel.cc +95 -88
  10. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +7 -7
  11. data/src/core/ext/filters/client_channel/client_channel_channelz.h +4 -2
  12. data/src/core/ext/filters/client_channel/client_channel_factory.cc +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +3 -3
  14. data/src/core/ext/filters/client_channel/connector.h +40 -45
  15. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +10 -10
  16. data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -13
  17. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +66 -37
  18. data/src/core/ext/filters/client_channel/http_proxy.cc +107 -116
  19. data/src/core/ext/filters/client_channel/http_proxy.h +5 -1
  20. data/src/core/ext/filters/client_channel/lb_policy.cc +3 -3
  21. data/src/core/ext/filters/client_channel/lb_policy.h +9 -5
  22. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +10 -8
  23. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +18 -19
  24. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +4 -3
  25. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
  26. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +1 -1
  27. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +3 -3
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +3 -3
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +6 -9
  30. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +368 -0
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +157 -77
  32. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +5 -5
  33. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
  34. data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +8 -8
  35. data/src/core/ext/filters/client_channel/proxy_mapper.h +14 -34
  36. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +46 -79
  37. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +23 -17
  38. data/src/core/ext/filters/client_channel/resolver.cc +2 -1
  39. data/src/core/ext/filters/client_channel/resolver.h +2 -2
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
  41. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +4 -4
  42. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
  43. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +13 -10
  44. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +3 -2
  45. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +9 -8
  46. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +17 -16
  47. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -2
  48. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +4 -4
  49. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +9 -9
  50. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -3
  51. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
  52. data/src/core/ext/filters/client_channel/resolver_factory.h +3 -3
  53. data/src/core/ext/filters/client_channel/resolver_registry.cc +14 -12
  54. data/src/core/ext/filters/client_channel/resolver_registry.h +6 -4
  55. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -6
  56. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +6 -6
  57. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +5 -5
  58. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +3 -3
  59. data/src/core/ext/filters/client_channel/service_config.cc +15 -14
  60. data/src/core/ext/filters/client_channel/service_config.h +14 -19
  61. data/src/core/ext/filters/client_channel/subchannel.cc +38 -36
  62. data/src/core/ext/filters/client_channel/subchannel.h +11 -12
  63. data/src/core/ext/filters/client_channel/subchannel_interface.h +1 -1
  64. data/src/core/ext/filters/client_channel/xds/xds_api.cc +19 -9
  65. data/src/core/ext/filters/client_channel/xds/xds_api.h +19 -9
  66. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +3 -3
  67. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +6 -5
  68. data/src/core/ext/filters/client_channel/xds/xds_client.cc +58 -31
  69. data/src/core/ext/filters/client_channel/xds/xds_client.h +20 -15
  70. data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +5 -3
  71. data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +18 -15
  72. data/src/core/ext/filters/client_idle/client_idle_filter.cc +10 -10
  73. data/src/core/ext/filters/deadline/deadline_filter.cc +15 -13
  74. data/src/core/ext/filters/http/client/http_client_filter.cc +12 -12
  75. data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
  76. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +13 -7
  77. data/src/core/ext/filters/http/server/http_server_filter.cc +14 -13
  78. data/src/core/ext/filters/max_age/max_age_filter.cc +16 -14
  79. data/src/core/ext/filters/message_size/message_size_filter.cc +10 -8
  80. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  81. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +9 -8
  82. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +141 -174
  83. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +31 -1
  84. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +7 -6
  85. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +14 -12
  86. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
  87. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +46 -38
  88. data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -2
  89. data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -5
  90. data/src/core/ext/transport/chttp2/transport/frame_data.cc +6 -7
  91. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -2
  92. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -1
  93. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -3
  94. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -5
  95. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +11 -8
  96. data/src/core/ext/transport/chttp2/transport/internal.h +3 -3
  97. data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -4
  98. data/src/core/ext/transport/chttp2/transport/writing.cc +3 -2
  99. data/src/core/ext/transport/inproc/inproc_transport.cc +65 -41
  100. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -1
  101. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +141 -70
  102. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +352 -118
  103. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -1
  104. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -1
  105. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +8 -4
  106. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +65 -0
  107. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -1
  108. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +16 -2
  109. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +36 -0
  110. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +12 -5
  111. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +34 -0
  112. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +1 -2
  113. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +13 -12
  114. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +28 -24
  115. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -1
  116. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +5 -4
  117. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +13 -0
  118. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -1
  119. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +23 -23
  120. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +48 -44
  121. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -1
  122. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -1
  123. data/src/core/ext/upb-generated/envoy/type/http.upb.c +16 -0
  124. data/src/core/ext/upb-generated/envoy/type/http.upb.h +36 -0
  125. data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -1
  126. data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -1
  127. data/src/core/lib/avl/avl.cc +1 -1
  128. data/src/core/lib/channel/channel_stack.cc +1 -1
  129. data/src/core/lib/channel/channel_stack.h +16 -4
  130. data/src/core/lib/channel/channel_trace.cc +4 -4
  131. data/src/core/lib/channel/channelz.cc +46 -46
  132. data/src/core/lib/channel/channelz.h +37 -35
  133. data/src/core/lib/channel/channelz_registry.cc +2 -2
  134. data/src/core/lib/channel/channelz_registry.h +1 -1
  135. data/src/core/lib/channel/connected_channel.cc +3 -2
  136. data/src/core/lib/channel/handshaker.cc +1 -1
  137. data/src/core/lib/channel/handshaker_registry.cc +5 -5
  138. data/src/core/lib/channel/handshaker_registry.h +3 -3
  139. data/src/core/lib/compression/message_compress.cc +3 -2
  140. data/src/core/lib/compression/stream_compression_identity.cc +5 -7
  141. data/src/core/lib/gpr/alloc.cc +4 -29
  142. data/src/core/lib/gpr/cpu_linux.cc +1 -1
  143. data/src/core/lib/gprpp/fork.cc +4 -4
  144. data/src/core/lib/gprpp/global_config_env.cc +7 -7
  145. data/src/core/lib/gprpp/global_config_env.h +2 -2
  146. data/src/core/lib/gprpp/host_port.cc +8 -8
  147. data/src/core/lib/gprpp/host_port.h +3 -3
  148. data/src/core/lib/gprpp/inlined_vector.h +13 -0
  149. data/src/core/lib/gprpp/map.h +2 -9
  150. data/src/core/lib/gprpp/memory.h +12 -98
  151. data/src/core/lib/gprpp/orphanable.h +3 -3
  152. data/src/core/lib/gprpp/ref_counted.h +3 -3
  153. data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
  154. data/src/core/lib/gprpp/string_view.h +45 -23
  155. data/src/core/lib/gprpp/thd.h +1 -1
  156. data/src/core/lib/gprpp/thd_posix.cc +6 -5
  157. data/src/core/lib/gprpp/thd_windows.cc +3 -3
  158. data/src/core/lib/http/httpcli.cc +1 -1
  159. data/src/core/lib/http/httpcli_security_connector.cc +3 -3
  160. data/src/core/lib/iomgr/buffer_list.cc +10 -5
  161. data/src/core/lib/iomgr/call_combiner.cc +7 -6
  162. data/src/core/lib/iomgr/call_combiner.h +4 -3
  163. data/src/core/lib/iomgr/cfstream_handle.cc +2 -2
  164. data/src/core/lib/iomgr/closure.h +33 -135
  165. data/src/core/lib/iomgr/combiner.cc +10 -17
  166. data/src/core/lib/iomgr/combiner.h +0 -2
  167. data/src/core/lib/iomgr/endpoint_cfstream.cc +2 -2
  168. data/src/core/lib/iomgr/endpoint_pair_posix.cc +1 -1
  169. data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -2
  170. data/src/core/lib/iomgr/ev_epollex_linux.cc +23 -13
  171. data/src/core/lib/iomgr/ev_poll_posix.cc +30 -17
  172. data/src/core/lib/iomgr/exec_ctx.cc +52 -5
  173. data/src/core/lib/iomgr/exec_ctx.h +6 -2
  174. data/src/core/lib/iomgr/executor.cc +16 -37
  175. data/src/core/lib/iomgr/executor.h +4 -7
  176. data/src/core/lib/iomgr/executor/threadpool.cc +4 -4
  177. data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
  178. data/src/core/lib/iomgr/lockfree_event.cc +9 -8
  179. data/src/core/lib/iomgr/logical_thread.cc +103 -0
  180. data/src/core/lib/iomgr/logical_thread.h +52 -0
  181. data/src/core/lib/iomgr/pollset_custom.cc +5 -5
  182. data/src/core/lib/iomgr/pollset_set_custom.cc +9 -9
  183. data/src/core/lib/iomgr/pollset_windows.cc +16 -2
  184. data/src/core/lib/iomgr/port.h +3 -0
  185. data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
  186. data/src/core/lib/iomgr/resolve_address_posix.cc +8 -9
  187. data/src/core/lib/iomgr/resolve_address_windows.cc +4 -6
  188. data/src/core/lib/iomgr/resource_quota.cc +26 -21
  189. data/src/core/lib/iomgr/socket_utils_common_posix.cc +11 -0
  190. data/src/core/lib/iomgr/socket_windows.cc +2 -2
  191. data/src/core/lib/iomgr/tcp_client_cfstream.cc +2 -2
  192. data/src/core/lib/iomgr/tcp_client_custom.cc +2 -2
  193. data/src/core/lib/iomgr/tcp_client_posix.cc +5 -4
  194. data/src/core/lib/iomgr/tcp_client_windows.cc +2 -2
  195. data/src/core/lib/iomgr/tcp_custom.cc +10 -9
  196. data/src/core/lib/iomgr/tcp_posix.cc +19 -15
  197. data/src/core/lib/iomgr/tcp_server_custom.cc +3 -2
  198. data/src/core/lib/iomgr/tcp_server_posix.cc +5 -4
  199. data/src/core/lib/iomgr/tcp_server_windows.cc +5 -3
  200. data/src/core/lib/iomgr/tcp_windows.cc +16 -13
  201. data/src/core/lib/iomgr/timer_custom.cc +4 -3
  202. data/src/core/lib/iomgr/timer_generic.cc +11 -9
  203. data/src/core/lib/iomgr/udp_server.cc +16 -13
  204. data/src/core/lib/security/credentials/alts/alts_credentials.cc +8 -5
  205. data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +45 -57
  206. data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -6
  207. data/src/core/lib/security/credentials/credentials.cc +8 -8
  208. data/src/core/lib/security/credentials/credentials.h +5 -5
  209. data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -5
  210. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -1
  211. data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -4
  212. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +4 -4
  213. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -2
  214. data/src/core/lib/security/credentials/local/local_credentials.cc +3 -3
  215. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +13 -11
  216. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -5
  217. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
  218. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -5
  219. data/src/core/lib/security/credentials/tls/spiffe_credentials.cc +2 -2
  220. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +28 -22
  221. data/src/core/lib/security/security_connector/alts/alts_security_connector.h +5 -0
  222. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
  223. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -1
  224. data/src/core/lib/security/security_connector/local/local_security_connector.cc +8 -8
  225. data/src/core/lib/security/security_connector/security_connector.h +1 -1
  226. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +9 -9
  227. data/src/core/lib/security/security_connector/ssl_utils.cc +5 -4
  228. data/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +14 -15
  229. data/src/core/lib/security/transport/client_auth_filter.cc +4 -3
  230. data/src/core/lib/security/transport/secure_endpoint.cc +9 -8
  231. data/src/core/lib/security/transport/security_handshaker.cc +67 -23
  232. data/src/core/lib/security/transport/server_auth_filter.cc +6 -5
  233. data/src/core/lib/security/transport/target_authority_table.h +1 -1
  234. data/src/core/lib/slice/b64.cc +3 -4
  235. data/src/core/lib/slice/b64.h +1 -2
  236. data/src/core/lib/slice/slice.cc +8 -13
  237. data/src/core/lib/surface/call.cc +19 -19
  238. data/src/core/lib/surface/call.h +6 -7
  239. data/src/core/lib/surface/call_log_batch.cc +1 -2
  240. data/src/core/lib/surface/channel.cc +17 -18
  241. data/src/core/lib/surface/channel.h +4 -19
  242. data/src/core/lib/surface/channel_ping.cc +1 -1
  243. data/src/core/lib/surface/completion_queue.cc +21 -22
  244. data/src/core/lib/surface/completion_queue_factory.cc +1 -1
  245. data/src/core/lib/surface/init.cc +1 -1
  246. data/src/core/lib/surface/init_secure.cc +2 -2
  247. data/src/core/lib/surface/lame_client.cc +10 -12
  248. data/src/core/lib/surface/server.cc +24 -18
  249. data/src/core/lib/surface/version.cc +2 -2
  250. data/src/core/lib/transport/byte_stream.cc +2 -2
  251. data/src/core/lib/transport/byte_stream.h +2 -1
  252. data/src/core/lib/transport/connectivity_state.cc +4 -4
  253. data/src/core/lib/transport/connectivity_state.h +2 -2
  254. data/src/core/lib/transport/metadata.cc +8 -10
  255. data/src/core/lib/transport/metadata.h +5 -8
  256. data/src/core/lib/transport/metadata_batch.cc +6 -0
  257. data/src/core/lib/transport/static_metadata.cc +2 -4
  258. data/src/core/lib/transport/status_metadata.cc +7 -0
  259. data/src/core/lib/transport/status_metadata.h +18 -0
  260. data/src/core/lib/transport/transport.cc +9 -7
  261. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
  262. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +292 -43
  263. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +197 -46
  264. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +4 -2
  265. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +5 -0
  266. data/src/core/tsi/ssl/session_cache/ssl_session.h +1 -1
  267. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  268. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +4 -4
  269. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
  270. data/src/core/tsi/ssl_transport_security.cc +2 -1
  271. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -4
  272. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +0 -6
  273. data/src/ruby/lib/grpc/version.rb +1 -1
  274. data/third_party/upb/upb/decode.c +1 -0
  275. metadata +34 -32
  276. data/src/core/ext/filters/client_channel/connector.cc +0 -41
  277. data/src/core/ext/filters/client_channel/proxy_mapper.cc +0 -48
  278. data/src/core/lib/gprpp/set.h +0 -33
@@ -36,13 +36,16 @@
36
36
  #include "src/core/lib/slice/b64.h"
37
37
  #include "src/core/lib/uri/uri_parser.h"
38
38
 
39
+ namespace grpc_core {
40
+ namespace {
41
+
39
42
  /**
40
43
  * Parses the 'https_proxy' env var (fallback on 'http_proxy') and returns the
41
44
  * proxy hostname to resolve or nullptr on error. Also sets 'user_cred' to user
42
45
  * credentials if present in the 'http_proxy' env var, otherwise leaves it
43
46
  * unchanged. It is caller's responsibility to gpr_free user_cred.
44
47
  */
45
- static char* get_http_proxy_server(char** user_cred) {
48
+ char* GetHttpProxyServer(char** user_cred) {
46
49
  GPR_ASSERT(user_cred != nullptr);
47
50
  char* proxy_name = nullptr;
48
51
  char** authority_strs = nullptr;
@@ -89,127 +92,115 @@ done:
89
92
  return proxy_name;
90
93
  }
91
94
 
92
- /**
93
- * Checks the value of GRPC_ARG_ENABLE_HTTP_PROXY to determine if http_proxy
94
- * should be used.
95
- */
96
- bool http_proxy_enabled(const grpc_channel_args* args) {
97
- const grpc_arg* arg =
98
- grpc_channel_args_find(args, GRPC_ARG_ENABLE_HTTP_PROXY);
99
- return grpc_channel_arg_get_bool(arg, true);
100
- }
101
-
102
- static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper,
103
- const char* server_uri,
104
- const grpc_channel_args* args,
105
- char** name_to_resolve,
106
- grpc_channel_args** new_args) {
107
- if (!http_proxy_enabled(args)) {
108
- return false;
109
- }
110
- char* user_cred = nullptr;
111
- *name_to_resolve = get_http_proxy_server(&user_cred);
112
- if (*name_to_resolve == nullptr) return false;
113
- char* no_proxy_str = nullptr;
114
- grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
115
- if (uri == nullptr || uri->path[0] == '\0') {
116
- gpr_log(GPR_ERROR,
117
- "'http_proxy' environment variable set, but cannot "
118
- "parse server URI '%s' -- not using proxy",
119
- server_uri);
120
- goto no_use_proxy;
121
- }
122
- if (strcmp(uri->scheme, "unix") == 0) {
123
- gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
124
- server_uri);
125
- goto no_use_proxy;
126
- }
127
- /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
128
- no_proxy_str = gpr_getenv("no_grpc_proxy");
129
- if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
130
- if (no_proxy_str != nullptr) {
131
- static const char* NO_PROXY_SEPARATOR = ",";
132
- bool use_proxy = true;
133
- grpc_core::UniquePtr<char> server_host;
134
- grpc_core::UniquePtr<char> server_port;
135
- if (!grpc_core::SplitHostPort(
136
- uri->path[0] == '/' ? uri->path + 1 : uri->path, &server_host,
137
- &server_port)) {
138
- gpr_log(GPR_INFO,
139
- "unable to split host and port, not checking no_proxy list for "
140
- "host '%s'",
95
+ class HttpProxyMapper : public ProxyMapperInterface {
96
+ public:
97
+ bool MapName(const char* server_uri, const grpc_channel_args* args,
98
+ char** name_to_resolve, grpc_channel_args** new_args) override {
99
+ if (!grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_HTTP_PROXY, true)) {
100
+ return false;
101
+ }
102
+ char* user_cred = nullptr;
103
+ *name_to_resolve = GetHttpProxyServer(&user_cred);
104
+ if (*name_to_resolve == nullptr) return false;
105
+ char* no_proxy_str = nullptr;
106
+ grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
107
+ if (uri == nullptr || uri->path[0] == '\0') {
108
+ gpr_log(GPR_ERROR,
109
+ "'http_proxy' environment variable set, but cannot "
110
+ "parse server URI '%s' -- not using proxy",
141
111
  server_uri);
142
- gpr_free(no_proxy_str);
143
- } else {
144
- size_t uri_len = strlen(server_host.get());
145
- char** no_proxy_hosts;
146
- size_t num_no_proxy_hosts;
147
- gpr_string_split(no_proxy_str, NO_PROXY_SEPARATOR, &no_proxy_hosts,
148
- &num_no_proxy_hosts);
149
- for (size_t i = 0; i < num_no_proxy_hosts; i++) {
150
- char* no_proxy_entry = no_proxy_hosts[i];
151
- size_t no_proxy_len = strlen(no_proxy_entry);
152
- if (no_proxy_len <= uri_len &&
153
- gpr_stricmp(no_proxy_entry,
154
- &(server_host.get()[uri_len - no_proxy_len])) == 0) {
155
- gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
156
- server_uri);
157
- use_proxy = false;
158
- break;
112
+ goto no_use_proxy;
113
+ }
114
+ if (strcmp(uri->scheme, "unix") == 0) {
115
+ gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
116
+ server_uri);
117
+ goto no_use_proxy;
118
+ }
119
+ /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
120
+ no_proxy_str = gpr_getenv("no_grpc_proxy");
121
+ if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
122
+ if (no_proxy_str != nullptr) {
123
+ static const char* NO_PROXY_SEPARATOR = ",";
124
+ bool use_proxy = true;
125
+ grpc_core::UniquePtr<char> server_host;
126
+ grpc_core::UniquePtr<char> server_port;
127
+ if (!grpc_core::SplitHostPort(
128
+ uri->path[0] == '/' ? uri->path + 1 : uri->path, &server_host,
129
+ &server_port)) {
130
+ gpr_log(GPR_INFO,
131
+ "unable to split host and port, not checking no_proxy list for "
132
+ "host '%s'",
133
+ server_uri);
134
+ gpr_free(no_proxy_str);
135
+ } else {
136
+ size_t uri_len = strlen(server_host.get());
137
+ char** no_proxy_hosts;
138
+ size_t num_no_proxy_hosts;
139
+ gpr_string_split(no_proxy_str, NO_PROXY_SEPARATOR, &no_proxy_hosts,
140
+ &num_no_proxy_hosts);
141
+ for (size_t i = 0; i < num_no_proxy_hosts; i++) {
142
+ char* no_proxy_entry = no_proxy_hosts[i];
143
+ size_t no_proxy_len = strlen(no_proxy_entry);
144
+ if (no_proxy_len <= uri_len &&
145
+ gpr_stricmp(no_proxy_entry,
146
+ &(server_host.get()[uri_len - no_proxy_len])) == 0) {
147
+ gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
148
+ server_uri);
149
+ use_proxy = false;
150
+ break;
151
+ }
159
152
  }
153
+ for (size_t i = 0; i < num_no_proxy_hosts; i++) {
154
+ gpr_free(no_proxy_hosts[i]);
155
+ }
156
+ gpr_free(no_proxy_hosts);
157
+ gpr_free(no_proxy_str);
158
+ if (!use_proxy) goto no_use_proxy;
160
159
  }
161
- for (size_t i = 0; i < num_no_proxy_hosts; i++) {
162
- gpr_free(no_proxy_hosts[i]);
163
- }
164
- gpr_free(no_proxy_hosts);
165
- gpr_free(no_proxy_str);
166
- if (!use_proxy) goto no_use_proxy;
167
160
  }
161
+ grpc_arg args_to_add[2];
162
+ args_to_add[0] = grpc_channel_arg_string_create(
163
+ (char*)GRPC_ARG_HTTP_CONNECT_SERVER,
164
+ uri->path[0] == '/' ? uri->path + 1 : uri->path);
165
+ if (user_cred != nullptr) {
166
+ /* Use base64 encoding for user credentials as stated in RFC 7617 */
167
+ char* encoded_user_cred =
168
+ grpc_base64_encode(user_cred, strlen(user_cred), 0, 0);
169
+ char* header;
170
+ gpr_asprintf(&header, "Proxy-Authorization:Basic %s", encoded_user_cred);
171
+ gpr_free(encoded_user_cred);
172
+ args_to_add[1] = grpc_channel_arg_string_create(
173
+ (char*)GRPC_ARG_HTTP_CONNECT_HEADERS, header);
174
+ *new_args = grpc_channel_args_copy_and_add(args, args_to_add, 2);
175
+ gpr_free(header);
176
+ } else {
177
+ *new_args = grpc_channel_args_copy_and_add(args, args_to_add, 1);
178
+ }
179
+ grpc_uri_destroy(uri);
180
+ gpr_free(user_cred);
181
+ return true;
182
+ no_use_proxy:
183
+ if (uri != nullptr) grpc_uri_destroy(uri);
184
+ gpr_free(*name_to_resolve);
185
+ *name_to_resolve = nullptr;
186
+ gpr_free(user_cred);
187
+ return false;
168
188
  }
169
- grpc_arg args_to_add[2];
170
- args_to_add[0] = grpc_channel_arg_string_create(
171
- (char*)GRPC_ARG_HTTP_CONNECT_SERVER,
172
- uri->path[0] == '/' ? uri->path + 1 : uri->path);
173
- if (user_cred != nullptr) {
174
- /* Use base64 encoding for user credentials as stated in RFC 7617 */
175
- char* encoded_user_cred =
176
- grpc_base64_encode(user_cred, strlen(user_cred), 0, 0);
177
- char* header;
178
- gpr_asprintf(&header, "Proxy-Authorization:Basic %s", encoded_user_cred);
179
- gpr_free(encoded_user_cred);
180
- args_to_add[1] = grpc_channel_arg_string_create(
181
- (char*)GRPC_ARG_HTTP_CONNECT_HEADERS, header);
182
- *new_args = grpc_channel_args_copy_and_add(args, args_to_add, 2);
183
- gpr_free(header);
184
- } else {
185
- *new_args = grpc_channel_args_copy_and_add(args, args_to_add, 1);
186
- }
187
- grpc_uri_destroy(uri);
188
- gpr_free(user_cred);
189
- return true;
190
- no_use_proxy:
191
- if (uri != nullptr) grpc_uri_destroy(uri);
192
- gpr_free(*name_to_resolve);
193
- *name_to_resolve = nullptr;
194
- gpr_free(user_cred);
195
- return false;
196
- }
197
-
198
- static bool proxy_mapper_map_address(grpc_proxy_mapper* mapper,
199
- const grpc_resolved_address* address,
200
- const grpc_channel_args* args,
201
- grpc_resolved_address** new_address,
202
- grpc_channel_args** new_args) {
203
- return false;
204
- }
205
-
206
- static void proxy_mapper_destroy(grpc_proxy_mapper* mapper) {}
207
189
 
208
- static const grpc_proxy_mapper_vtable proxy_mapper_vtable = {
209
- proxy_mapper_map_name, proxy_mapper_map_address, proxy_mapper_destroy};
190
+ bool MapAddress(const grpc_resolved_address& address,
191
+ const grpc_channel_args* args,
192
+ grpc_resolved_address** new_address,
193
+ grpc_channel_args** new_args) override {
194
+ return false;
195
+ }
196
+ };
210
197
 
211
- static grpc_proxy_mapper proxy_mapper = {&proxy_mapper_vtable};
198
+ } // namespace
212
199
 
213
- void grpc_register_http_proxy_mapper() {
214
- grpc_proxy_mapper_register(true /* at_start */, &proxy_mapper);
200
+ void RegisterHttpProxyMapper() {
201
+ ProxyMapperRegistry::Register(
202
+ true /* at_start */,
203
+ std::unique_ptr<ProxyMapperInterface>(new HttpProxyMapper()));
215
204
  }
205
+
206
+ } // namespace grpc_core
@@ -19,6 +19,10 @@
19
19
  #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
20
20
  #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
21
21
 
22
- void grpc_register_http_proxy_mapper();
22
+ namespace grpc_core {
23
+
24
+ void RegisterHttpProxyMapper();
25
+
26
+ } // namespace grpc_core
23
27
 
24
28
  #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
@@ -90,7 +90,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
90
90
  //
91
91
 
92
92
  LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
93
- PickArgs args) {
93
+ PickArgs /*args*/) {
94
94
  // We invoke the parent's ExitIdleLocked() via a closure instead
95
95
  // of doing it directly here, for two reasons:
96
96
  // 1. ExitIdleLocked() may cause the policy's state to change and
@@ -115,7 +115,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
115
115
  }
116
116
 
117
117
  void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
118
- grpc_error* error) {
118
+ grpc_error* /*error*/) {
119
119
  LoadBalancingPolicy* parent = static_cast<LoadBalancingPolicy*>(arg);
120
120
  parent->ExitIdleLocked();
121
121
  parent->Unref();
@@ -126,7 +126,7 @@ void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
126
126
  //
127
127
 
128
128
  LoadBalancingPolicy::PickResult
129
- LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs args) {
129
+ LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) {
130
130
  PickResult result;
131
131
  result.type = PickResult::PICK_FAILED;
132
132
  result.error = GRPC_ERROR_REF(error_);
@@ -21,6 +21,7 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
+ #include <functional>
24
25
  #include <iterator>
25
26
 
26
27
  #include "src/core/ext/filters/client_channel/server_address.h"
@@ -92,11 +93,11 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
92
93
  /// Application-specific requests cost metrics. Metric names are
93
94
  /// determined by the application. Each value is an absolute cost
94
95
  /// (e.g. 3487 bytes of storage) associated with the request.
95
- Map<StringView, double, StringLess> request_cost;
96
+ std::map<StringView, double, StringLess> request_cost;
96
97
  /// Application-specific resource utilization metrics. Metric names
97
98
  /// are determined by the application. Each value is expressed as a
98
99
  /// fraction of total resources available.
99
- Map<StringView, double, StringLess> utilization;
100
+ std::map<StringView, double, StringLess> utilization;
100
101
  };
101
102
 
102
103
  /// Interface for accessing per-call state.
@@ -268,7 +269,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
268
269
  /// Sets the connectivity state and returns a new picker to be used
269
270
  /// by the client channel.
270
271
  virtual void UpdateState(grpc_connectivity_state state,
271
- UniquePtr<SubchannelPicker>) = 0;
272
+ std::unique_ptr<SubchannelPicker>) = 0;
272
273
 
273
274
  /// Requests that the resolver re-resolve.
274
275
  virtual void RequestReresolution() = 0;
@@ -317,9 +318,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
317
318
  /// Channel control helper.
318
319
  /// Note: LB policies MUST NOT call any method on the helper from
319
320
  /// their constructor.
320
- UniquePtr<ChannelControlHelper> channel_control_helper;
321
+ std::unique_ptr<ChannelControlHelper> channel_control_helper;
321
322
  /// Channel args.
322
323
  // TODO(roth): Find a better channel args representation for this API.
324
+ // TODO(roth): Clarify ownership semantics here -- currently, this
325
+ // does not take ownership of args, which is the opposite of how we
326
+ // handle them in UpdateArgs.
323
327
  const grpc_channel_args* args = nullptr;
324
328
  };
325
329
 
@@ -400,7 +404,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
400
404
  /// Owned pointer to interested parties in load balancing decisions.
401
405
  grpc_pollset_set* interested_parties_;
402
406
  /// Channel control helper.
403
- UniquePtr<ChannelControlHelper> channel_control_helper_;
407
+ std::unique_ptr<ChannelControlHelper> channel_control_helper_;
404
408
  };
405
409
 
406
410
  } // namespace grpc_core
@@ -30,12 +30,12 @@
30
30
  #include "src/core/lib/iomgr/error.h"
31
31
  #include "src/core/lib/profiling/timers.h"
32
32
 
33
- static grpc_error* clr_init_channel_elem(grpc_channel_element* elem,
34
- grpc_channel_element_args* args) {
33
+ static grpc_error* clr_init_channel_elem(grpc_channel_element* /*elem*/,
34
+ grpc_channel_element_args* /*args*/) {
35
35
  return GRPC_ERROR_NONE;
36
36
  }
37
37
 
38
- static void clr_destroy_channel_elem(grpc_channel_element* elem) {}
38
+ static void clr_destroy_channel_elem(grpc_channel_element* /*elem*/) {}
39
39
 
40
40
  namespace {
41
41
 
@@ -59,7 +59,8 @@ static void on_complete_for_send(void* arg, grpc_error* error) {
59
59
  if (error == GRPC_ERROR_NONE) {
60
60
  calld->send_initial_metadata_succeeded = true;
61
61
  }
62
- GRPC_CLOSURE_RUN(calld->original_on_complete_for_send, GRPC_ERROR_REF(error));
62
+ grpc_core::Closure::Run(DEBUG_LOCATION, calld->original_on_complete_for_send,
63
+ GRPC_ERROR_REF(error));
63
64
  }
64
65
 
65
66
  static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
@@ -67,8 +68,9 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
67
68
  if (error == GRPC_ERROR_NONE) {
68
69
  calld->recv_initial_metadata_succeeded = true;
69
70
  }
70
- GRPC_CLOSURE_RUN(calld->original_recv_initial_metadata_ready,
71
- GRPC_ERROR_REF(error));
71
+ grpc_core::Closure::Run(DEBUG_LOCATION,
72
+ calld->original_recv_initial_metadata_ready,
73
+ GRPC_ERROR_REF(error));
72
74
  }
73
75
 
74
76
  static grpc_error* clr_init_call_elem(grpc_call_element* elem,
@@ -79,8 +81,8 @@ static grpc_error* clr_init_call_elem(grpc_call_element* elem,
79
81
  }
80
82
 
81
83
  static void clr_destroy_call_elem(grpc_call_element* elem,
82
- const grpc_call_final_info* final_info,
83
- grpc_closure* ignored) {
84
+ const grpc_call_final_info* /*final_info*/,
85
+ grpc_closure* /*ignored*/) {
84
86
  call_data* calld = static_cast<call_data*>(elem->call_data);
85
87
  if (calld->client_stats != nullptr) {
86
88
  // Record call finished, optionally setting client_failed_to_send and
@@ -237,7 +237,7 @@ class GrpcLb : public LoadBalancingPolicy {
237
237
  const grpc_grpclb_serverlist* serverlist() const { return serverlist_; }
238
238
 
239
239
  // Returns a text representation suitable for logging.
240
- UniquePtr<char> AsText() const;
240
+ grpc_core::UniquePtr<char> AsText() const;
241
241
 
242
242
  // Extracts all non-drop entries into a ServerAddressList.
243
243
  ServerAddressList GetServerAddressList(
@@ -268,7 +268,7 @@ class GrpcLb : public LoadBalancingPolicy {
268
268
  class Picker : public SubchannelPicker {
269
269
  public:
270
270
  Picker(GrpcLb* parent, RefCountedPtr<Serverlist> serverlist,
271
- UniquePtr<SubchannelPicker> child_picker,
271
+ std::unique_ptr<SubchannelPicker> child_picker,
272
272
  RefCountedPtr<GrpcLbClientStats> client_stats)
273
273
  : parent_(parent),
274
274
  serverlist_(std::move(serverlist)),
@@ -285,7 +285,7 @@ class GrpcLb : public LoadBalancingPolicy {
285
285
  // Serverlist to be used for determining drops.
286
286
  RefCountedPtr<Serverlist> serverlist_;
287
287
 
288
- UniquePtr<SubchannelPicker> child_picker_;
288
+ std::unique_ptr<SubchannelPicker> child_picker_;
289
289
  RefCountedPtr<GrpcLbClientStats> client_stats_;
290
290
  };
291
291
 
@@ -297,7 +297,7 @@ class GrpcLb : public LoadBalancingPolicy {
297
297
  RefCountedPtr<SubchannelInterface> CreateSubchannel(
298
298
  const grpc_channel_args& args) override;
299
299
  void UpdateState(grpc_connectivity_state state,
300
- UniquePtr<SubchannelPicker> picker) override;
300
+ std::unique_ptr<SubchannelPicker> picker) override;
301
301
  void RequestReresolution() override;
302
302
  void AddTraceEvent(TraceSeverity severity, StringView message) override;
303
303
 
@@ -430,7 +430,7 @@ void ParseServer(const grpc_grpclb_server* server,
430
430
  }
431
431
  }
432
432
 
433
- UniquePtr<char> GrpcLb::Serverlist::AsText() const {
433
+ grpc_core::UniquePtr<char> GrpcLb::Serverlist::AsText() const {
434
434
  gpr_strvec entries;
435
435
  gpr_strvec_init(&entries);
436
436
  for (size_t i = 0; i < serverlist_->num_servers; ++i) {
@@ -449,7 +449,7 @@ UniquePtr<char> GrpcLb::Serverlist::AsText() const {
449
449
  gpr_free(ipport);
450
450
  gpr_strvec_add(&entries, entry);
451
451
  }
452
- UniquePtr<char> result(gpr_strvec_flatten(&entries, nullptr));
452
+ grpc_core::UniquePtr<char> result(gpr_strvec_flatten(&entries, nullptr));
453
453
  gpr_strvec_destroy(&entries);
454
454
  return result;
455
455
  }
@@ -468,7 +468,7 @@ void client_stats_destroy(void* p) {
468
468
  GrpcLbClientStats* client_stats = static_cast<GrpcLbClientStats*>(p);
469
469
  client_stats->Unref();
470
470
  }
471
- int equal_cmp(void* p1, void* p2) {
471
+ int equal_cmp(void* /*p1*/, void* /*p2*/) {
472
472
  // Always indicate a match, since we don't want this channel arg to
473
473
  // affect the subchannel's key in the index.
474
474
  // TODO(roth): Is this right? This does prevent us from needlessly
@@ -479,8 +479,7 @@ int equal_cmp(void* p1, void* p2) {
479
479
  // token or client stats. A better approach might be to find somewhere
480
480
  // other than the subchannel args to store the LB token and client
481
481
  // stats. They could be stored in a map and then looked up for each
482
- // call (although we'd need to make sure our Map<> implementation is
483
- // performant enough). Or we could do something more complicated whereby
482
+ // call. Or we could do something more complicated whereby
484
483
  // we create our own subchannel wrapper to store them, although that would
485
484
  // involve a lot of refcounting overhead.
486
485
  // Given that we're trying to move from grpclb to xds at this point,
@@ -658,7 +657,7 @@ RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
658
657
  }
659
658
 
660
659
  void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
661
- UniquePtr<SubchannelPicker> picker) {
660
+ std::unique_ptr<SubchannelPicker> picker) {
662
661
  if (parent_->shutting_down_) return;
663
662
  // If this request is from the pending child policy, ignore it until
664
663
  // it reports READY, at which point we swap it into place.
@@ -1025,8 +1024,8 @@ void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg,
1025
1024
  GRPC_ERROR_REF(error));
1026
1025
  }
1027
1026
 
1028
- void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(void* arg,
1029
- grpc_error* error) {
1027
+ void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(
1028
+ void* arg, grpc_error* /*error*/) {
1030
1029
  BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
1031
1030
  grpc_byte_buffer_destroy(lb_calld->send_message_payload_);
1032
1031
  lb_calld->send_message_payload_ = nullptr;
@@ -1050,7 +1049,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceived(void* arg,
1050
1049
  }
1051
1050
 
1052
1051
  void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked(
1053
- void* arg, grpc_error* error) {
1052
+ void* arg, grpc_error* /*error*/) {
1054
1053
  BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
1055
1054
  GrpcLb* grpclb_policy = lb_calld->grpclb_policy();
1056
1055
  // Null payload means the LB call was cancelled.
@@ -1100,7 +1099,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked(
1100
1099
  GPR_ASSERT(lb_calld->lb_call_ != nullptr);
1101
1100
  auto serverlist_wrapper = MakeRefCounted<Serverlist>(serverlist);
1102
1101
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
1103
- UniquePtr<char> serverlist_text = serverlist_wrapper->AsText();
1102
+ grpc_core::UniquePtr<char> serverlist_text = serverlist_wrapper->AsText();
1104
1103
  gpr_log(GPR_INFO,
1105
1104
  "[grpclb %p] lb_calld=%p: Serverlist with %" PRIuPTR
1106
1105
  " servers received:\n%s",
@@ -1547,7 +1546,7 @@ void GrpcLb::OnBalancerChannelConnectivityChanged(void* arg,
1547
1546
  }
1548
1547
 
1549
1548
  void GrpcLb::OnBalancerChannelConnectivityChangedLocked(void* arg,
1550
- grpc_error* error) {
1549
+ grpc_error* /*error*/) {
1551
1550
  GrpcLb* self = static_cast<GrpcLb*>(arg);
1552
1551
  if (!self->shutting_down_ && self->fallback_at_startup_checks_pending_) {
1553
1552
  if (self->lb_channel_connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
@@ -1725,12 +1724,12 @@ grpc_channel_args* GrpcLb::CreateChildPolicyArgsLocked(
1725
1724
 
1726
1725
  OrphanablePtr<LoadBalancingPolicy> GrpcLb::CreateChildPolicyLocked(
1727
1726
  const char* name, const grpc_channel_args* args) {
1728
- Helper* helper = New<Helper>(Ref());
1727
+ Helper* helper = new Helper(Ref());
1729
1728
  LoadBalancingPolicy::Args lb_policy_args;
1730
1729
  lb_policy_args.combiner = combiner();
1731
1730
  lb_policy_args.args = args;
1732
1731
  lb_policy_args.channel_control_helper =
1733
- UniquePtr<ChannelControlHelper>(helper);
1732
+ std::unique_ptr<ChannelControlHelper>(helper);
1734
1733
  OrphanablePtr<LoadBalancingPolicy> lb_policy =
1735
1734
  LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
1736
1735
  name, std::move(lb_policy_args));
@@ -1884,7 +1883,7 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
1884
1883
  GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
1885
1884
  if (json == nullptr) {
1886
1885
  return RefCountedPtr<LoadBalancingPolicy::Config>(
1887
- New<ParsedGrpcLbConfig>(nullptr));
1886
+ new ParsedGrpcLbConfig(nullptr));
1888
1887
  }
1889
1888
  InlinedVector<grpc_error*, 2> error_list;
1890
1889
  RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
@@ -1906,7 +1905,7 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
1906
1905
  }
1907
1906
  if (error_list.empty()) {
1908
1907
  return RefCountedPtr<LoadBalancingPolicy::Config>(
1909
- New<ParsedGrpcLbConfig>(std::move(child_policy)));
1908
+ new ParsedGrpcLbConfig(std::move(child_policy)));
1910
1909
  } else {
1911
1910
  *error = GRPC_ERROR_CREATE_FROM_VECTOR("GrpcLb Parser", &error_list);
1912
1911
  return nullptr;