grpc 1.27.0 → 1.28.0.pre2

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 (678) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +707 -629
  3. data/include/grpc/impl/codegen/grpc_types.h +5 -0
  4. data/include/grpc/impl/codegen/port_platform.h +7 -0
  5. data/include/grpc/impl/codegen/sync.h +5 -3
  6. data/include/grpc/impl/codegen/sync_abseil.h +36 -0
  7. data/include/grpc/module.modulemap +3 -0
  8. data/include/grpc/support/sync_abseil.h +26 -0
  9. data/src/core/ext/filters/client_channel/client_channel.cc +47 -29
  10. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +31 -47
  11. data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -3
  12. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
  13. data/src/core/ext/filters/client_channel/http_proxy.cc +4 -1
  14. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +21 -28
  15. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +18 -21
  16. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +9 -13
  17. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +46 -72
  18. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +413 -422
  19. data/src/core/ext/filters/client_channel/lb_policy_factory.h +3 -3
  20. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +43 -75
  21. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
  22. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +57 -70
  23. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +1 -1
  24. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -1
  25. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +1 -1
  26. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +3 -3
  27. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +2 -2
  28. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -1
  29. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +3 -3
  30. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +4 -2
  31. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +228 -286
  32. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +2 -2
  33. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +13 -14
  34. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +5 -7
  35. data/src/core/ext/filters/client_channel/service_config.cc +91 -160
  36. data/src/core/ext/filters/client_channel/service_config.h +14 -21
  37. data/src/core/ext/filters/client_channel/xds/xds_api.cc +581 -251
  38. data/src/core/ext/filters/client_channel/xds/xds_api.h +189 -151
  39. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +133 -350
  40. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +18 -39
  41. data/src/core/ext/filters/client_channel/xds/xds_channel.h +3 -1
  42. data/src/core/ext/filters/client_channel/xds/xds_channel_secure.cc +12 -9
  43. data/src/core/ext/filters/client_channel/xds/xds_client.cc +559 -242
  44. data/src/core/ext/filters/client_channel/xds/xds_client.h +54 -34
  45. data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +53 -128
  46. data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +105 -132
  47. data/src/core/ext/filters/message_size/message_size_filter.cc +32 -35
  48. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  49. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +3 -6
  50. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +4 -6
  51. data/src/core/ext/transport/chttp2/transport/writing.cc +1 -1
  52. data/src/core/ext/transport/inproc/inproc_transport.cc +22 -42
  53. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +17 -0
  54. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +30 -0
  55. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +27 -0
  56. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +54 -0
  57. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +46 -21
  58. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +116 -29
  59. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +4 -362
  60. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +14 -1337
  61. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +390 -0
  62. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +1411 -0
  63. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +29 -8
  64. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +60 -0
  65. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +1 -0
  66. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +1 -0
  67. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +5 -3
  68. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +6 -2
  69. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +48 -5
  70. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +154 -4
  71. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +19 -15
  72. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +46 -32
  73. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +26 -4
  74. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +70 -0
  75. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +42 -25
  76. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +83 -25
  77. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +1 -0
  78. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +43 -7
  79. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +115 -0
  80. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +1 -0
  81. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +7 -68
  82. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +14 -201
  83. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +91 -0
  84. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +240 -0
  85. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +1 -71
  86. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +3 -228
  87. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.c +88 -0
  88. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +258 -0
  89. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +1 -0
  90. data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.c +30 -0
  91. data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +53 -0
  92. data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.c +104 -0
  93. data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +383 -0
  94. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.c +17 -0
  95. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +33 -0
  96. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +144 -0
  97. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +527 -0
  98. data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.c +42 -0
  99. data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +112 -0
  100. data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.c +29 -0
  101. data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +53 -0
  102. data/src/core/ext/upb-generated/envoy/api/v2/route.upb.c +62 -0
  103. data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +199 -0
  104. data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.c +17 -0
  105. data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +33 -0
  106. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +793 -0
  107. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +2936 -0
  108. data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.c +58 -0
  109. data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +134 -0
  110. data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.c +27 -0
  111. data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +53 -0
  112. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +227 -0
  113. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +725 -0
  114. data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.c +296 -0
  115. data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +1072 -0
  116. data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.c +32 -0
  117. data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +65 -0
  118. data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.c +47 -0
  119. data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +108 -0
  120. data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.c +52 -0
  121. data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +133 -0
  122. data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.c +87 -0
  123. data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +258 -0
  124. data/src/core/ext/upb-generated/envoy/type/range.upb.c +11 -0
  125. data/src/core/ext/upb-generated/envoy/type/range.upb.h +27 -0
  126. data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.c +28 -0
  127. data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +62 -0
  128. data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.c +88 -0
  129. data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +249 -0
  130. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +30 -27
  131. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +64 -52
  132. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +48 -0
  133. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +104 -0
  134. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +17 -0
  135. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +30 -0
  136. data/src/core/ext/upb-generated/validate/validate.upb.c +38 -34
  137. data/src/core/ext/upb-generated/validate/validate.upb.h +129 -99
  138. data/src/core/lib/channel/channel_trace.cc +32 -41
  139. data/src/core/lib/channel/channel_trace.h +3 -3
  140. data/src/core/lib/channel/channelz.cc +158 -248
  141. data/src/core/lib/channel/channelz.h +12 -15
  142. data/src/core/lib/channel/channelz_registry.cc +47 -74
  143. data/src/core/lib/channel/channelz_registry.h +4 -4
  144. data/src/core/lib/gpr/sync_abseil.cc +114 -0
  145. data/src/core/lib/gpr/sync_posix.cc +8 -5
  146. data/src/core/lib/gpr/sync_windows.cc +4 -2
  147. data/src/core/lib/gprpp/host_port.cc +1 -1
  148. data/src/core/lib/gprpp/inlined_vector.h +1 -210
  149. data/src/core/lib/gprpp/memory.h +2 -6
  150. data/src/core/lib/gprpp/optional.h +0 -41
  151. data/src/core/lib/gprpp/string_view.h +5 -114
  152. data/src/core/lib/iomgr/buffer_list.cc +36 -35
  153. data/src/core/lib/iomgr/error.h +4 -4
  154. data/src/core/lib/iomgr/ev_epollex_linux.cc +12 -4
  155. data/src/core/lib/iomgr/load_file.cc +1 -0
  156. data/src/core/lib/iomgr/tcp_client_posix.cc +17 -17
  157. data/src/core/lib/iomgr/tcp_client_posix.h +6 -6
  158. data/src/core/lib/iomgr/tcp_posix.cc +2 -1
  159. data/src/core/lib/iomgr/work_serializer.cc +155 -0
  160. data/src/core/lib/iomgr/work_serializer.h +65 -0
  161. data/src/core/lib/json/json.h +209 -79
  162. data/src/core/lib/json/json_reader.cc +469 -455
  163. data/src/core/lib/json/json_writer.cc +173 -169
  164. data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +1 -1
  165. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +10 -8
  166. data/src/core/lib/security/credentials/jwt/json_token.cc +26 -56
  167. data/src/core/lib/security/credentials/jwt/json_token.h +2 -1
  168. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +8 -18
  169. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +149 -159
  170. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -3
  171. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +37 -34
  172. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
  173. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -1
  174. data/src/core/lib/security/security_connector/local/local_security_connector.cc +5 -7
  175. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +3 -15
  176. data/src/core/lib/security/security_connector/ssl_utils.cc +3 -1
  177. data/src/core/lib/security/security_connector/ssl_utils.h +0 -1
  178. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +24 -1
  179. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +5 -1
  180. data/src/core/lib/security/transport/security_handshaker.cc +2 -2
  181. data/src/core/lib/security/util/json_util.cc +22 -15
  182. data/src/core/lib/security/util/json_util.h +2 -2
  183. data/src/core/lib/surface/version.cc +1 -1
  184. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +1 -1
  185. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +1 -1
  186. data/src/core/tsi/grpc_shadow_boringssl.h +1333 -1319
  187. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  188. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
  189. data/src/core/tsi/ssl_transport_security.cc +2 -1
  190. data/src/ruby/lib/grpc/version.rb +1 -1
  191. data/third_party/abseil-cpp/absl/base/attributes.h +1 -1
  192. data/third_party/abseil-cpp/absl/base/config.h +10 -4
  193. data/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +30 -9
  194. data/third_party/abseil-cpp/absl/base/internal/errno_saver.h +43 -0
  195. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +7 -5
  196. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +2 -1
  197. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +2 -2
  198. data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -3
  199. data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +3 -3
  200. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +37 -0
  201. data/third_party/abseil-cpp/absl/base/options.h +2 -10
  202. data/third_party/abseil-cpp/absl/strings/charconv.cc +0 -1
  203. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +388 -0
  204. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +432 -0
  205. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +245 -0
  206. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +209 -0
  207. data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +326 -0
  208. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +51 -0
  209. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +415 -0
  210. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +493 -0
  211. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +23 -0
  212. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +72 -0
  213. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +104 -0
  214. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +334 -0
  215. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +333 -0
  216. data/third_party/abseil-cpp/absl/strings/str_format.h +537 -0
  217. data/third_party/abseil-cpp/absl/strings/string_view.h +19 -11
  218. data/{src/boringssl → third_party/boringssl-with-bazel}/err_data.c +0 -0
  219. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bitstr.c +0 -0
  220. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_bool.c +0 -0
  221. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_d2i_fp.c +0 -0
  222. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_dup.c +0 -0
  223. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_enum.c +0 -0
  224. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_gentm.c +0 -0
  225. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_i2d_fp.c +0 -0
  226. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_int.c +0 -0
  227. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_mbstr.c +0 -0
  228. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_object.c +0 -0
  229. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_octet.c +0 -0
  230. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_print.c +0 -0
  231. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_strnid.c +0 -0
  232. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_time.c +3 -4
  233. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_type.c +0 -0
  234. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utctm.c +0 -0
  235. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/a_utf8.c +0 -0
  236. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_lib.c +0 -0
  237. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_locl.h +0 -0
  238. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn1_par.c +0 -0
  239. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/asn_pack.c +0 -0
  240. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_enum.c +0 -0
  241. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_int.c +0 -0
  242. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/f_string.c +0 -0
  243. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_dec.c +0 -0
  244. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_enc.c +0 -0
  245. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_fre.c +0 -0
  246. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_new.c +0 -0
  247. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_typ.c +0 -0
  248. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/tasn_utl.c +0 -0
  249. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/asn1/time_support.c +0 -0
  250. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/base64/base64.c +0 -0
  251. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio.c +0 -0
  252. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/bio_mem.c +0 -0
  253. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/connect.c +3 -4
  254. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/fd.c +0 -1
  255. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/file.c +5 -6
  256. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/hexdump.c +0 -0
  257. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/internal.h +0 -0
  258. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/pair.c +0 -1
  259. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/printf.c +0 -0
  260. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket.c +0 -0
  261. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bio/socket_helper.c +0 -0
  262. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/bn_asn1.c +0 -0
  263. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bn_extra/convert.c +0 -0
  264. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/buf/buf.c +10 -69
  265. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/asn1_compat.c +0 -0
  266. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/ber.c +0 -0
  267. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbb.c +41 -2
  268. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/cbs.c +60 -3
  269. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/internal.h +0 -0
  270. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/bytestring/unicode.c +0 -0
  271. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/chacha.c +0 -0
  272. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/chacha/internal.h +0 -0
  273. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/cipher_extra.c +0 -0
  274. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/derive_key.c +0 -0
  275. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesccm.c +0 -0
  276. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesctrhmac.c +0 -0
  277. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_aesgcmsiv.c +8 -0
  278. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_chacha20poly1305.c +0 -0
  279. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_null.c +0 -0
  280. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc2.c +0 -0
  281. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_rc4.c +0 -0
  282. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/e_tls.c +0 -0
  283. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/internal.h +0 -0
  284. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cipher_extra/tls_cbc.c +0 -0
  285. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cmac/cmac.c +0 -0
  286. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf.c +0 -0
  287. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/conf_def.h +0 -0
  288. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/conf/internal.h +0 -0
  289. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-fuchsia.c +0 -0
  290. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-aarch64-linux.c +0 -0
  291. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.c +0 -1
  292. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm-linux.h +0 -0
  293. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-arm.c +0 -0
  294. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-intel.c +0 -0
  295. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/cpu-ppc64le.c +0 -0
  296. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/crypto.c +0 -0
  297. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/curve25519/spake25519.c +0 -0
  298. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/check.c +3 -3
  299. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh.c +1 -2
  300. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/dh_asn1.c +0 -0
  301. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dh/params.c +0 -0
  302. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/digest_extra/digest_extra.c +0 -0
  303. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa.c +0 -0
  304. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/dsa/dsa_asn1.c +0 -0
  305. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_asn1.c +0 -0
  306. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ec_extra/ec_derive.c +2 -3
  307. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdh_extra/ecdh_extra.c +0 -0
  308. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ecdsa_extra/ecdsa_asn1.c +0 -0
  309. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/engine/engine.c +0 -0
  310. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/err.c +6 -6
  311. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/err/internal.h +0 -0
  312. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/digestsign.c +0 -0
  313. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp.c +0 -0
  314. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_asn1.c +0 -0
  315. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/evp_ctx.c +0 -0
  316. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/internal.h +0 -0
  317. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_dsa_asn1.c +0 -0
  318. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec.c +0 -1
  319. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ec_asn1.c +0 -0
  320. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519.c +0 -0
  321. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_ed25519_asn1.c +0 -0
  322. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa.c +14 -2
  323. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_rsa_asn1.c +0 -0
  324. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519.c +0 -0
  325. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/p_x25519_asn1.c +1 -2
  326. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/pbkdf.c +0 -0
  327. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/print.c +0 -0
  328. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/scrypt.c +0 -0
  329. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/evp/sign.c +0 -0
  330. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/ex_data.c +0 -0
  331. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes.c +108 -0
  332. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes_nohw.c +1282 -0
  333. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/internal.h +5 -7
  334. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/key_wrap.c +0 -0
  335. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/aes/mode_wrappers.c +0 -2
  336. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bcm.c +2 -0
  337. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/add.c +0 -0
  338. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/asm/x86_64-gcc.c +0 -0
  339. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bn.c +0 -0
  340. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/bytes.c +0 -0
  341. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/cmp.c +0 -0
  342. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/ctx.c +0 -0
  343. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div.c +0 -0
  344. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/div_extra.c +0 -0
  345. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/exponentiation.c +0 -0
  346. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd.c +0 -0
  347. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/gcd_extra.c +0 -0
  348. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/generic.c +0 -0
  349. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/internal.h +0 -0
  350. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/jacobi.c +0 -0
  351. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery.c +0 -0
  352. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/montgomery_inv.c +0 -0
  353. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/mul.c +0 -0
  354. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/prime.c +11 -12
  355. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/random.c +0 -0
  356. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.c +0 -0
  357. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/rsaz_exp.h +0 -0
  358. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/shift.c +0 -0
  359. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/bn/sqrt.c +0 -0
  360. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/aead.c +0 -0
  361. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/cipher.c +0 -0
  362. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_aes.c +3 -5
  363. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/e_des.c +0 -0
  364. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/cipher/internal.h +0 -0
  365. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/delocate.h +0 -0
  366. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/des.c +0 -0
  367. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/des/internal.h +0 -0
  368. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digest.c +0 -0
  369. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/digests.c +0 -0
  370. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/internal.h +0 -0
  371. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/digest/md32_common.h +0 -0
  372. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec.c +0 -0
  373. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_key.c +1 -1
  374. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/ec_montgomery.c +0 -0
  375. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/felem.c +0 -0
  376. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/internal.h +0 -0
  377. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/oct.c +0 -0
  378. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p224-64.c +0 -0
  379. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64-table.h +0 -0
  380. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.c +0 -0
  381. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/p256-x86_64.h +0 -0
  382. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/scalar.c +0 -0
  383. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple.c +0 -0
  384. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/simple_mul.c +0 -0
  385. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/util.c +0 -0
  386. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ec/wnaf.c +0 -0
  387. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdh/ecdh.c +0 -0
  388. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/ecdsa/ecdsa.c +0 -0
  389. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/fips_shared_support.c +0 -0
  390. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/hmac/hmac.c +0 -0
  391. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/is_fips.c +0 -0
  392. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md4/md4.c +0 -0
  393. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/internal.h +0 -0
  394. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/md5/md5.c +0 -0
  395. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cbc.c +0 -0
  396. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/cfb.c +0 -0
  397. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ctr.c +0 -0
  398. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/gcm.c +45 -193
  399. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +304 -0
  400. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/internal.h +8 -18
  401. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/ofb.c +0 -0
  402. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/modes/polyval.c +0 -0
  403. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/ctrdrbg.c +0 -0
  404. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/internal.h +0 -0
  405. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/rand.c +0 -0
  406. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rand/urandom.c +0 -0
  407. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/blinding.c +0 -0
  408. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/internal.h +0 -0
  409. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/padding.c +0 -0
  410. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa.c +7 -1
  411. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/rsa/rsa_impl.c +60 -51
  412. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/self_check/self_check.c +0 -0
  413. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/internal.h +0 -0
  414. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1-altivec.c +0 -0
  415. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha1.c +0 -0
  416. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha256.c +0 -0
  417. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/sha/sha512.c +0 -0
  418. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/internal.h +0 -0
  419. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/fipsmodule/tls/kdf.c +0 -0
  420. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hkdf/hkdf.c +0 -0
  421. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/hrss.c +210 -311
  422. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/hrss/internal.h +0 -1
  423. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/internal.h +21 -1
  424. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/lhash/lhash.c +0 -0
  425. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/mem.c +70 -0
  426. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj.c +16 -21
  427. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_dat.h +27 -6
  428. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/obj/obj_xref.c +0 -0
  429. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_all.c +0 -0
  430. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_info.c +0 -1
  431. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_lib.c +7 -7
  432. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_oth.c +0 -1
  433. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pk8.c +0 -1
  434. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_pkey.c +0 -1
  435. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_x509.c +0 -0
  436. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pem/pem_xaux.c +0 -0
  437. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/internal.h +0 -0
  438. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7.c +0 -0
  439. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs7/pkcs7_x509.c +1 -1
  440. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/internal.h +0 -0
  441. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/p5_pbev2.c +0 -0
  442. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8.c +0 -0
  443. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pkcs8/pkcs8_x509.c +0 -0
  444. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/internal.h +0 -0
  445. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305.c +2 -2
  446. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_arm.c +21 -20
  447. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/poly1305/poly1305_vec.c +34 -17
  448. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/internal.h +0 -0
  449. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/pool/pool.c +1 -2
  450. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/deterministic.c +0 -0
  451. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/forkunsafe.c +0 -0
  452. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/fuchsia.c +0 -0
  453. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/rand_extra.c +0 -0
  454. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rand_extra/windows.c +0 -0
  455. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rc4/rc4.c +0 -0
  456. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_c11.c +0 -0
  457. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/refcount_lock.c +0 -0
  458. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_asn1.c +0 -0
  459. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/rsa_extra/rsa_print.c +0 -0
  460. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/siphash/siphash.c +3 -1
  461. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/stack/stack.c +0 -0
  462. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread.c +0 -0
  463. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_none.c +0 -0
  464. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_pthread.c +0 -0
  465. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/thread_win.c +0 -0
  466. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_digest.c +0 -0
  467. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_sign.c +0 -0
  468. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_strex.c +0 -0
  469. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/a_verify.c +0 -1
  470. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/algorithm.c +0 -0
  471. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/asn1_gen.c +0 -0
  472. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_dir.c +1 -1
  473. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/by_file.c +0 -1
  474. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/charmap.h +0 -0
  475. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/i2d_pr.c +0 -0
  476. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/internal.h +0 -0
  477. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/rsa_pss.c +0 -0
  478. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_crl.c +0 -0
  479. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_req.c +0 -0
  480. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509.c +0 -0
  481. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/t_x509a.c +0 -0
  482. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/vpm_int.h +0 -0
  483. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509.c +0 -0
  484. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_att.c +0 -0
  485. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_cmp.c +0 -1
  486. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_d2.c +0 -0
  487. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_def.c +0 -0
  488. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_ext.c +0 -0
  489. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_lu.c +0 -0
  490. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_obj.c +1 -1
  491. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_r2x.c +0 -1
  492. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_req.c +0 -1
  493. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_set.c +0 -0
  494. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_trs.c +1 -2
  495. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_txt.c +0 -0
  496. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_v3.c +0 -0
  497. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vfy.c +0 -1
  498. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509_vpm.c +3 -4
  499. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509cset.c +0 -0
  500. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509name.c +0 -0
  501. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509rset.c +0 -0
  502. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x509spki.c +0 -0
  503. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_algor.c +0 -0
  504. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_all.c +0 -1
  505. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_attrib.c +0 -0
  506. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_crl.c +0 -0
  507. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_exten.c +0 -0
  508. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_info.c +0 -0
  509. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_name.c +0 -0
  510. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pkey.c +0 -0
  511. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_pubkey.c +0 -0
  512. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_req.c +0 -0
  513. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_sig.c +0 -0
  514. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_spki.c +0 -0
  515. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_val.c +0 -0
  516. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509.c +0 -0
  517. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509/x_x509a.c +0 -0
  518. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/ext_dat.h +0 -0
  519. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/internal.h +0 -0
  520. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_cache.c +0 -0
  521. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_data.c +0 -0
  522. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_int.h +0 -0
  523. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_lib.c +0 -0
  524. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_map.c +0 -0
  525. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_node.c +0 -0
  526. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/pcy_tree.c +0 -0
  527. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akey.c +0 -0
  528. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_akeya.c +0 -0
  529. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_alt.c +3 -3
  530. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bcons.c +0 -0
  531. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_bitst.c +0 -0
  532. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_conf.c +0 -0
  533. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_cpols.c +0 -0
  534. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_crld.c +0 -0
  535. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_enum.c +2 -2
  536. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_extku.c +0 -0
  537. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_genn.c +0 -0
  538. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ia5.c +0 -0
  539. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_info.c +4 -5
  540. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_int.c +0 -0
  541. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_lib.c +0 -0
  542. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ncons.c +0 -0
  543. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_ocsp.c +0 -0
  544. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pci.c +0 -0
  545. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcia.c +0 -0
  546. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pcons.c +0 -0
  547. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pku.c +0 -0
  548. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_pmaps.c +0 -0
  549. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_prn.c +0 -0
  550. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_purp.c +2 -3
  551. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_skey.c +0 -0
  552. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_sxnet.c +0 -0
  553. data/third_party/{boringssl → boringssl-with-bazel/src}/crypto/x509v3/v3_utl.c +11 -12
  554. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aead.h +0 -0
  555. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/aes.h +0 -0
  556. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/arm_arch.h +0 -0
  557. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1.h +0 -0
  558. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1_mac.h +0 -0
  559. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/asn1t.h +0 -0
  560. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base.h +0 -0
  561. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/base64.h +0 -0
  562. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bio.h +0 -0
  563. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/blowfish.h +0 -0
  564. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bn.h +32 -20
  565. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buf.h +9 -9
  566. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/buffer.h +0 -0
  567. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/bytestring.h +34 -0
  568. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cast.h +0 -0
  569. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/chacha.h +0 -0
  570. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cipher.h +0 -0
  571. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cmac.h +0 -0
  572. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/conf.h +0 -0
  573. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/cpu.h +0 -0
  574. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/crypto.h +0 -0
  575. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/curve25519.h +0 -0
  576. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/des.h +0 -0
  577. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dh.h +0 -0
  578. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/digest.h +0 -0
  579. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dsa.h +0 -0
  580. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/dtls1.h +0 -0
  581. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/e_os2.h +0 -0
  582. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec.h +11 -4
  583. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ec_key.h +4 -2
  584. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdh.h +0 -0
  585. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ecdsa.h +0 -0
  586. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/engine.h +0 -0
  587. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/err.h +11 -9
  588. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/evp.h +20 -0
  589. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ex_data.h +0 -0
  590. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hkdf.h +0 -0
  591. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hmac.h +0 -0
  592. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/hrss.h +0 -0
  593. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/is_boringssl.h +0 -0
  594. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/lhash.h +0 -0
  595. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md4.h +0 -0
  596. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/md5.h +0 -0
  597. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/mem.h +17 -2
  598. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/nid.h +9 -0
  599. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj.h +0 -0
  600. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/obj_mac.h +0 -0
  601. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/objects.h +0 -0
  602. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslconf.h +0 -0
  603. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/opensslv.h +0 -0
  604. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ossl_typ.h +0 -0
  605. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pem.h +0 -0
  606. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs12.h +0 -0
  607. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs7.h +0 -0
  608. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pkcs8.h +0 -0
  609. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/poly1305.h +5 -7
  610. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/pool.h +0 -0
  611. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rand.h +0 -0
  612. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rc4.h +0 -0
  613. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ripemd.h +0 -0
  614. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/rsa.h +0 -0
  615. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/safestack.h +0 -0
  616. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/sha.h +0 -0
  617. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/siphash.h +0 -0
  618. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/span.h +0 -0
  619. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/srtp.h +0 -0
  620. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl.h +10 -20
  621. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/ssl3.h +0 -0
  622. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/stack.h +0 -0
  623. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/thread.h +0 -0
  624. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/tls1.h +0 -3
  625. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/type_check.h +0 -0
  626. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509.h +0 -0
  627. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509_vfy.h +0 -0
  628. data/third_party/{boringssl → boringssl-with-bazel/src}/include/openssl/x509v3.h +0 -0
  629. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/bio_ssl.cc +0 -0
  630. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_both.cc +0 -1
  631. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_lib.cc +0 -0
  632. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_pkt.cc +0 -1
  633. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/d1_srtp.cc +0 -0
  634. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_method.cc +0 -1
  635. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/dtls_record.cc +0 -0
  636. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handoff.cc +126 -29
  637. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake.cc +5 -4
  638. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_client.cc +24 -13
  639. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/handshake_server.cc +1 -5
  640. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/internal.h +32 -26
  641. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_both.cc +0 -0
  642. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_lib.cc +2 -3
  643. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/s3_pkt.cc +0 -1
  644. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_aead_ctx.cc +0 -0
  645. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_asn1.cc +1 -2
  646. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_buffer.cc +34 -15
  647. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cert.cc +0 -1
  648. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_cipher.cc +0 -1
  649. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_file.cc +0 -0
  650. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_key_share.cc +0 -0
  651. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_lib.cc +13 -14
  652. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_privkey.cc +0 -0
  653. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_session.cc +2 -1
  654. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_stat.cc +0 -0
  655. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_transcript.cc +0 -0
  656. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_versions.cc +1 -1
  657. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/ssl_x509.cc +0 -0
  658. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_enc.cc +0 -0
  659. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/t1_lib.cc +11 -171
  660. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_both.cc +0 -0
  661. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_client.cc +3 -4
  662. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_enc.cc +5 -1
  663. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls13_server.cc +78 -101
  664. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_method.cc +1 -1
  665. data/third_party/{boringssl → boringssl-with-bazel/src}/ssl/tls_record.cc +7 -2
  666. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519.c +0 -0
  667. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_32.h +0 -0
  668. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_64.h +0 -0
  669. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/curve25519_tables.h +0 -0
  670. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/internal.h +0 -0
  671. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256.c +0 -0
  672. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_32.h +0 -0
  673. data/third_party/{boringssl → boringssl-with-bazel/src}/third_party/fiat/p256_64.h +0 -0
  674. metadata +562 -491
  675. data/src/core/lib/iomgr/logical_thread.cc +0 -103
  676. data/src/core/lib/iomgr/logical_thread.h +0 -52
  677. data/src/core/lib/json/json.cc +0 -94
  678. data/third_party/boringssl/crypto/fipsmodule/aes/aes.c +0 -860
@@ -74,12 +74,12 @@ namespace {
74
74
 
75
75
  constexpr char kXds[] = "xds_experimental";
76
76
 
77
- class ParsedXdsConfig : public LoadBalancingPolicy::Config {
77
+ class XdsConfig : public LoadBalancingPolicy::Config {
78
78
  public:
79
- ParsedXdsConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
80
- RefCountedPtr<LoadBalancingPolicy::Config> fallback_policy,
81
- std::string eds_service_name,
82
- Optional<std::string> lrs_load_reporting_server_name)
79
+ XdsConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
80
+ RefCountedPtr<LoadBalancingPolicy::Config> fallback_policy,
81
+ std::string eds_service_name,
82
+ Optional<std::string> lrs_load_reporting_server_name)
83
83
  : child_policy_(std::move(child_policy)),
84
84
  fallback_policy_(std::move(fallback_policy)),
85
85
  eds_service_name_(std::move(eds_service_name)),
@@ -123,31 +123,42 @@ class XdsLb : public LoadBalancingPolicy {
123
123
  private:
124
124
  class EndpointWatcher;
125
125
 
126
- // We need this wrapper for the following reasons:
127
- // 1. To process per-locality load reporting.
128
- // 2. Since pickers are std::unique_ptrs we use this RefCounted wrapper to
129
- // control
130
- // references to it by the xds picker and the locality.
131
- class EndpointPickerWrapper : public RefCounted<EndpointPickerWrapper> {
126
+ // A simple wrapper to convert the picker returned from a locality's child
127
+ // policy as a unique_ptr<> to a RefCountedPtr<>. This allows it to be
128
+ // referenced by both the picker and the locality.
129
+ class RefCountedEndpointPicker : public RefCounted<RefCountedEndpointPicker> {
132
130
  public:
133
- EndpointPickerWrapper(
134
- std::unique_ptr<SubchannelPicker> picker,
135
- RefCountedPtr<XdsClientStats::LocalityStats> locality_stats)
131
+ explicit RefCountedEndpointPicker(std::unique_ptr<SubchannelPicker> picker)
132
+ : picker_(std::move(picker)) {}
133
+ PickResult Pick(PickArgs args) { return picker_->Pick(std::move(args)); }
134
+
135
+ private:
136
+ std::unique_ptr<SubchannelPicker> picker_;
137
+ };
138
+
139
+ // A picker that wraps the RefCountedEndpointPicker and performs load
140
+ // reporting for the locality.
141
+ class LoadReportingPicker : public RefCounted<LoadReportingPicker> {
142
+ public:
143
+ LoadReportingPicker(RefCountedPtr<RefCountedEndpointPicker> picker,
144
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats)
136
145
  : picker_(std::move(picker)),
137
- locality_stats_(std::move(locality_stats)) {
138
- locality_stats_->RefByPicker();
139
- }
140
- ~EndpointPickerWrapper() { locality_stats_->UnrefByPicker(); }
146
+ locality_stats_(std::move(locality_stats)) {}
141
147
 
142
148
  PickResult Pick(PickArgs args);
143
149
 
150
+ RefCountedEndpointPicker* picker() const { return picker_.get(); }
151
+ XdsClusterLocalityStats* locality_stats() const {
152
+ return locality_stats_.get();
153
+ }
154
+
144
155
  private:
145
- std::unique_ptr<SubchannelPicker> picker_;
146
- RefCountedPtr<XdsClientStats::LocalityStats> locality_stats_;
156
+ RefCountedPtr<RefCountedEndpointPicker> picker_;
157
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
147
158
  };
148
159
 
149
- // The picker will use a stateless weighting algorithm to pick the locality to
150
- // use for each request.
160
+ // A picker that uses a stateless weighting algorithm to pick the locality
161
+ // to use for each request.
151
162
  class LocalityPicker : public SubchannelPicker {
152
163
  public:
153
164
  // Maintains a weighted list of pickers from each locality that is in ready
@@ -155,14 +166,12 @@ class XdsLb : public LoadBalancingPolicy {
155
166
  // proportional to the locality's weight. The start of the range is the
156
167
  // previous value in the vector and is 0 for the first element.
157
168
  using PickerList =
158
- InlinedVector<std::pair<uint32_t, RefCountedPtr<EndpointPickerWrapper>>,
169
+ InlinedVector<std::pair<uint32_t, RefCountedPtr<LoadReportingPicker>>,
159
170
  1>;
160
- LocalityPicker(RefCountedPtr<XdsLb> xds_policy, PickerList pickers)
161
- : xds_policy_(std::move(xds_policy)),
162
- pickers_(std::move(pickers)),
163
- drop_config_(xds_policy_->drop_config_) {}
164
-
165
- ~LocalityPicker() { xds_policy_.reset(DEBUG_LOCATION, "LocalityPicker"); }
171
+ LocalityPicker(XdsLb* xds_policy, PickerList pickers)
172
+ : drop_stats_(xds_policy->drop_stats_),
173
+ drop_config_(xds_policy->drop_config_),
174
+ pickers_(std::move(pickers)) {}
166
175
 
167
176
  PickResult Pick(PickArgs args) override;
168
177
 
@@ -170,9 +179,9 @@ class XdsLb : public LoadBalancingPolicy {
170
179
  // Calls the picker of the locality that the key falls within.
171
180
  PickResult PickFromLocality(const uint32_t key, PickArgs args);
172
181
 
173
- RefCountedPtr<XdsLb> xds_policy_;
182
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
183
+ RefCountedPtr<XdsApi::DropConfig> drop_config_;
174
184
  PickerList pickers_;
175
- RefCountedPtr<XdsDropConfig> drop_config_;
176
185
  };
177
186
 
178
187
  class FallbackHelper : public ChannelControlHelper {
@@ -199,206 +208,168 @@ class XdsLb : public LoadBalancingPolicy {
199
208
  LoadBalancingPolicy* child_ = nullptr;
200
209
  };
201
210
 
202
- // There is only one PriorityList instance, which has the same lifetime with
203
- // the XdsLb instance.
204
- class PriorityList {
211
+ // Each LocalityMap holds a ref to the XdsLb.
212
+ class LocalityMap : public InternallyRefCounted<LocalityMap> {
205
213
  public:
206
- // Each LocalityMap holds a ref to the XdsLb.
207
- class LocalityMap : public InternallyRefCounted<LocalityMap> {
214
+ // Each Locality holds a ref to the LocalityMap it is in.
215
+ class Locality : public InternallyRefCounted<Locality> {
208
216
  public:
209
- // Each Locality holds a ref to the LocalityMap it is in.
210
- class Locality : public InternallyRefCounted<Locality> {
211
- public:
212
- Locality(RefCountedPtr<LocalityMap> locality_map,
213
- RefCountedPtr<XdsLocalityName> name);
214
- ~Locality();
215
-
216
- void UpdateLocked(uint32_t locality_weight,
217
- ServerAddressList serverlist);
218
- void ShutdownLocked();
219
- void ResetBackoffLocked();
220
- void DeactivateLocked();
221
- void Orphan() override;
222
-
223
- grpc_connectivity_state connectivity_state() const {
224
- return connectivity_state_;
225
- }
226
- uint32_t weight() const { return weight_; }
227
- RefCountedPtr<EndpointPickerWrapper> picker_wrapper() const {
228
- return picker_wrapper_;
229
- }
217
+ Locality(RefCountedPtr<LocalityMap> locality_map,
218
+ RefCountedPtr<XdsLocalityName> name);
219
+ ~Locality();
230
220
 
231
- void set_locality_map(RefCountedPtr<LocalityMap> locality_map) {
232
- locality_map_ = std::move(locality_map);
233
- }
234
-
235
- private:
236
- class Helper : public ChannelControlHelper {
237
- public:
238
- explicit Helper(RefCountedPtr<Locality> locality)
239
- : locality_(std::move(locality)) {}
240
-
241
- ~Helper() { locality_.reset(DEBUG_LOCATION, "Helper"); }
242
-
243
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
244
- const grpc_channel_args& args) override;
245
- void UpdateState(grpc_connectivity_state state,
246
- std::unique_ptr<SubchannelPicker> picker) override;
247
- // This is a no-op, because we get the addresses from the xds
248
- // client, which is a watch-based API.
249
- void RequestReresolution() override {}
250
- void AddTraceEvent(TraceSeverity severity,
251
- StringView message) override;
252
- void set_child(LoadBalancingPolicy* child) { child_ = child; }
253
-
254
- private:
255
- bool CalledByPendingChild() const;
256
- bool CalledByCurrentChild() const;
257
-
258
- RefCountedPtr<Locality> locality_;
259
- LoadBalancingPolicy* child_ = nullptr;
260
- };
261
-
262
- // Methods for dealing with the child policy.
263
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
264
- const char* name, const grpc_channel_args* args);
265
- grpc_channel_args* CreateChildPolicyArgsLocked(
266
- const grpc_channel_args* args);
267
-
268
- static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
269
- static void OnDelayedRemovalTimerLocked(void* arg, grpc_error* error);
270
-
271
- XdsLb* xds_policy() const { return locality_map_->xds_policy(); }
272
-
273
- // The owning locality map.
274
- RefCountedPtr<LocalityMap> locality_map_;
275
-
276
- RefCountedPtr<XdsLocalityName> name_;
277
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
278
- OrphanablePtr<LoadBalancingPolicy> pending_child_policy_;
279
- RefCountedPtr<EndpointPickerWrapper> picker_wrapper_;
280
- grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
281
- uint32_t weight_;
282
-
283
- // States for delayed removal.
284
- grpc_timer delayed_removal_timer_;
285
- grpc_closure on_delayed_removal_timer_;
286
- bool delayed_removal_timer_callback_pending_ = false;
287
- bool shutdown_ = false;
288
- };
289
-
290
- LocalityMap(RefCountedPtr<XdsLb> xds_policy, uint32_t priority);
291
-
292
- ~LocalityMap() { xds_policy_.reset(DEBUG_LOCATION, "LocalityMap"); }
293
-
294
- void UpdateLocked(
295
- const XdsPriorityListUpdate::LocalityMap& locality_map_update);
221
+ void UpdateLocked(uint32_t locality_weight, ServerAddressList serverlist,
222
+ bool update_locality_stats);
223
+ void ShutdownLocked();
296
224
  void ResetBackoffLocked();
297
- void UpdateXdsPickerLocked();
298
- OrphanablePtr<Locality> ExtractLocalityLocked(
299
- const RefCountedPtr<XdsLocalityName>& name);
300
225
  void DeactivateLocked();
301
- // Returns true if this locality map becomes the currently used one (i.e.,
302
- // its priority is selected) after reactivation.
303
- bool MaybeReactivateLocked();
304
- void MaybeCancelFailoverTimerLocked();
305
-
306
226
  void Orphan() override;
307
227
 
308
- XdsLb* xds_policy() const { return xds_policy_.get(); }
309
- uint32_t priority() const { return priority_; }
228
+ uint32_t weight() const { return weight_; }
229
+
310
230
  grpc_connectivity_state connectivity_state() const {
311
231
  return connectivity_state_;
312
232
  }
313
- bool failover_timer_callback_pending() const {
314
- return failover_timer_callback_pending_;
233
+
234
+ RefCountedPtr<LoadReportingPicker> GetLoadReportingPicker() {
235
+ // Recreate load reporting picker if stats object has changed.
236
+ if (load_reporting_picker_ == nullptr ||
237
+ load_reporting_picker_->picker() != picker_wrapper_.get() ||
238
+ load_reporting_picker_->locality_stats() != stats_.get()) {
239
+ load_reporting_picker_ =
240
+ MakeRefCounted<LoadReportingPicker>(picker_wrapper_, stats_);
241
+ }
242
+ return load_reporting_picker_;
243
+ }
244
+
245
+ void set_locality_map(RefCountedPtr<LocalityMap> locality_map) {
246
+ locality_map_ = std::move(locality_map);
315
247
  }
316
248
 
317
249
  private:
318
- void OnLocalityStateUpdateLocked();
319
- void UpdateConnectivityStateLocked();
250
+ class Helper : public ChannelControlHelper {
251
+ public:
252
+ explicit Helper(RefCountedPtr<Locality> locality)
253
+ : locality_(std::move(locality)) {}
254
+
255
+ ~Helper() { locality_.reset(DEBUG_LOCATION, "Helper"); }
256
+
257
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
258
+ const grpc_channel_args& args) override;
259
+ void UpdateState(grpc_connectivity_state state,
260
+ std::unique_ptr<SubchannelPicker> picker) override;
261
+ // This is a no-op, because we get the addresses from the xds
262
+ // client, which is a watch-based API.
263
+ void RequestReresolution() override {}
264
+ void AddTraceEvent(TraceSeverity severity, StringView message) override;
265
+ void set_child(LoadBalancingPolicy* child) { child_ = child; }
266
+
267
+ private:
268
+ bool CalledByPendingChild() const;
269
+ bool CalledByCurrentChild() const;
270
+
271
+ RefCountedPtr<Locality> locality_;
272
+ LoadBalancingPolicy* child_ = nullptr;
273
+ };
274
+
275
+ // Methods for dealing with the child policy.
276
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
277
+ const char* name, const grpc_channel_args* args);
278
+ grpc_channel_args* CreateChildPolicyArgsLocked(
279
+ const grpc_channel_args* args);
280
+
281
+ void UpdateLocalityStats();
282
+
320
283
  static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
321
- static void OnFailoverTimer(void* arg, grpc_error* error);
322
284
  static void OnDelayedRemovalTimerLocked(void* arg, grpc_error* error);
323
- static void OnFailoverTimerLocked(void* arg, grpc_error* error);
324
285
 
325
- PriorityList* priority_list() const {
326
- return &xds_policy_->priority_list_;
327
- }
328
- const XdsPriorityListUpdate& priority_list_update() const {
329
- return xds_policy_->priority_list_update_;
330
- }
331
- const XdsPriorityListUpdate::LocalityMap* locality_map_update() const {
332
- return xds_policy_->priority_list_update_.Find(priority_);
333
- }
286
+ XdsLb* xds_policy() const { return locality_map_->xds_policy(); }
334
287
 
335
- RefCountedPtr<XdsLb> xds_policy_;
288
+ // The owning locality map.
289
+ RefCountedPtr<LocalityMap> locality_map_;
336
290
 
337
- std::map<RefCountedPtr<XdsLocalityName>, OrphanablePtr<Locality>,
338
- XdsLocalityName::Less>
339
- localities_;
340
- const uint32_t priority_;
291
+ RefCountedPtr<XdsLocalityName> name_;
292
+ RefCountedPtr<XdsClusterLocalityStats> stats_;
293
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
294
+ OrphanablePtr<LoadBalancingPolicy> pending_child_policy_;
295
+ RefCountedPtr<RefCountedEndpointPicker> picker_wrapper_;
296
+ RefCountedPtr<LoadReportingPicker> load_reporting_picker_;
341
297
  grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
298
+ uint32_t weight_;
342
299
 
343
300
  // States for delayed removal.
344
301
  grpc_timer delayed_removal_timer_;
345
302
  grpc_closure on_delayed_removal_timer_;
346
303
  bool delayed_removal_timer_callback_pending_ = false;
347
-
348
- // States of failover.
349
- grpc_timer failover_timer_;
350
- grpc_closure on_failover_timer_;
351
- bool failover_timer_callback_pending_ = false;
304
+ bool shutdown_ = false;
352
305
  };
353
306
 
354
- explicit PriorityList(XdsLb* xds_policy) : xds_policy_(xds_policy) {}
307
+ LocalityMap(RefCountedPtr<XdsLb> xds_policy, uint32_t priority);
355
308
 
356
- void UpdateLocked();
309
+ ~LocalityMap() { xds_policy_.reset(DEBUG_LOCATION, "LocalityMap"); }
310
+
311
+ void UpdateLocked(
312
+ const XdsApi::PriorityListUpdate::LocalityMap& locality_map_update,
313
+ bool update_locality_stats);
357
314
  void ResetBackoffLocked();
358
- void ShutdownLocked();
359
315
  void UpdateXdsPickerLocked();
360
-
361
- const XdsPriorityListUpdate& priority_list_update() const {
362
- return xds_policy_->priority_list_update_;
316
+ OrphanablePtr<Locality> ExtractLocalityLocked(
317
+ const RefCountedPtr<XdsLocalityName>& name);
318
+ void DeactivateLocked();
319
+ // Returns true if this locality map becomes the currently used one (i.e.,
320
+ // its priority is selected) after reactivation.
321
+ bool MaybeReactivateLocked();
322
+ void MaybeCancelFailoverTimerLocked();
323
+
324
+ void Orphan() override;
325
+
326
+ XdsLb* xds_policy() const { return xds_policy_.get(); }
327
+ uint32_t priority() const { return priority_; }
328
+ grpc_connectivity_state connectivity_state() const {
329
+ return connectivity_state_;
330
+ }
331
+ bool failover_timer_callback_pending() const {
332
+ return failover_timer_callback_pending_;
363
333
  }
364
- uint32_t current_priority() const { return current_priority_; }
365
334
 
366
335
  private:
367
- void MaybeCreateLocalityMapLocked(uint32_t priority);
368
- void FailoverOnConnectionFailureLocked();
369
- void FailoverOnDisconnectionLocked(uint32_t failed_priority);
370
- void SwitchToHigherPriorityLocked(uint32_t priority);
371
- void DeactivatePrioritiesLowerThan(uint32_t priority);
372
- OrphanablePtr<LocalityMap::Locality> ExtractLocalityLocked(
373
- const RefCountedPtr<XdsLocalityName>& name, uint32_t exclude_priority);
374
- // Callers should make sure the priority list is non-empty.
375
- uint32_t LowestPriority() const {
376
- return static_cast<uint32_t>(priorities_.size()) - 1;
336
+ void OnLocalityStateUpdateLocked();
337
+ void UpdateConnectivityStateLocked();
338
+ static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
339
+ static void OnFailoverTimer(void* arg, grpc_error* error);
340
+ static void OnDelayedRemovalTimerLocked(void* arg, grpc_error* error);
341
+ static void OnFailoverTimerLocked(void* arg, grpc_error* error);
342
+
343
+ const XdsApi::PriorityListUpdate& priority_list_update() const {
344
+ return xds_policy_->priority_list_update_;
345
+ }
346
+ const XdsApi::PriorityListUpdate::LocalityMap* locality_map_update() const {
347
+ return xds_policy_->priority_list_update_.Find(priority_);
377
348
  }
378
- bool Contains(uint32_t priority) { return priority < priorities_.size(); }
379
349
 
380
- XdsLb* xds_policy_;
350
+ RefCountedPtr<XdsLb> xds_policy_;
381
351
 
382
- // The list of locality maps, indexed by priority. P0 is the highest
383
- // priority.
384
- InlinedVector<OrphanablePtr<LocalityMap>, 2> priorities_;
385
- // The priority that is being used.
386
- uint32_t current_priority_ = UINT32_MAX;
352
+ std::map<RefCountedPtr<XdsLocalityName>, OrphanablePtr<Locality>,
353
+ XdsLocalityName::Less>
354
+ localities_;
355
+ const uint32_t priority_;
356
+ grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
357
+
358
+ // States for delayed removal.
359
+ grpc_timer delayed_removal_timer_;
360
+ grpc_closure on_delayed_removal_timer_;
361
+ bool delayed_removal_timer_callback_pending_ = false;
362
+
363
+ // States of failover.
364
+ grpc_timer failover_timer_;
365
+ grpc_closure on_failover_timer_;
366
+ bool failover_timer_callback_pending_ = false;
387
367
  };
388
368
 
389
369
  ~XdsLb();
390
370
 
391
371
  void ShutdownLocked() override;
392
372
 
393
- // Methods for dealing with fallback state.
394
- void MaybeCancelFallbackAtStartupChecks();
395
- static void OnFallbackTimer(void* arg, grpc_error* error);
396
- static void OnFallbackTimerLocked(void* arg, grpc_error* error);
397
- void UpdateFallbackPolicyLocked();
398
- OrphanablePtr<LoadBalancingPolicy> CreateFallbackPolicyLocked(
399
- const char* name, const grpc_channel_args* args);
400
- void MaybeExitFallbackMode();
401
-
402
373
  const char* eds_service_name() const {
403
374
  if (config_ != nullptr && config_->eds_service_name() != nullptr) {
404
375
  return config_->eds_service_name();
@@ -411,12 +382,36 @@ class XdsLb : public LoadBalancingPolicy {
411
382
  : xds_client_.get();
412
383
  }
413
384
 
385
+ void UpdatePrioritiesLocked(bool update_locality_stats);
386
+ void UpdateXdsPickerLocked();
387
+ void MaybeCreateLocalityMapLocked(uint32_t priority);
388
+ void FailoverOnConnectionFailureLocked();
389
+ void FailoverOnDisconnectionLocked(uint32_t failed_priority);
390
+ void SwitchToHigherPriorityLocked(uint32_t priority);
391
+ void DeactivatePrioritiesLowerThan(uint32_t priority);
392
+ OrphanablePtr<LocalityMap::Locality> ExtractLocalityLocked(
393
+ const RefCountedPtr<XdsLocalityName>& name, uint32_t exclude_priority);
394
+ // Callers should make sure the priority list is non-empty.
395
+ uint32_t LowestPriority() const {
396
+ return static_cast<uint32_t>(priorities_.size()) - 1;
397
+ }
398
+ bool Contains(uint32_t priority) { return priority < priorities_.size(); }
399
+
400
+ // Methods for dealing with fallback state.
401
+ void MaybeCancelFallbackAtStartupChecks();
402
+ static void OnFallbackTimer(void* arg, grpc_error* error);
403
+ static void OnFallbackTimerLocked(void* arg, grpc_error* error);
404
+ void UpdateFallbackPolicyLocked();
405
+ OrphanablePtr<LoadBalancingPolicy> CreateFallbackPolicyLocked(
406
+ const char* name, const grpc_channel_args* args);
407
+ void MaybeExitFallbackMode();
408
+
414
409
  // Server name from target URI.
415
410
  std::string server_name_;
416
411
 
417
412
  // Current channel args and config from the resolver.
418
413
  const grpc_channel_args* args_ = nullptr;
419
- RefCountedPtr<ParsedXdsConfig> config_;
414
+ RefCountedPtr<XdsConfig> config_;
420
415
 
421
416
  // Internal state.
422
417
  bool shutting_down_ = false;
@@ -454,23 +449,26 @@ class XdsLb : public LoadBalancingPolicy {
454
449
 
455
450
  const grpc_millis locality_retention_interval_ms_;
456
451
  const grpc_millis locality_map_failover_timeout_ms_;
457
- // A list of locality maps indexed by priority.
458
- PriorityList priority_list_;
452
+ // The list of locality maps, indexed by priority. P0 is the highest
453
+ // priority.
454
+ InlinedVector<OrphanablePtr<LocalityMap>, 2> priorities_;
455
+ // The priority that is being used.
456
+ uint32_t current_priority_ = UINT32_MAX;
459
457
  // The update for priority_list_.
460
- XdsPriorityListUpdate priority_list_update_;
458
+ XdsApi::PriorityListUpdate priority_list_update_;
461
459
 
462
460
  // The config for dropping calls.
463
- RefCountedPtr<XdsDropConfig> drop_config_;
461
+ RefCountedPtr<XdsApi::DropConfig> drop_config_;
464
462
 
465
- // The stats for client-side load reporting.
466
- XdsClientStats client_stats_;
463
+ // Drop stats for client-side load reporting.
464
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
467
465
  };
468
466
 
469
467
  //
470
- // XdsLb::EndpointPickerWrapper
468
+ // XdsLb::LoadReportingPicker
471
469
  //
472
470
 
473
- LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick(
471
+ LoadBalancingPolicy::PickResult XdsLb::LoadReportingPicker::Pick(
474
472
  LoadBalancingPolicy::PickArgs args) {
475
473
  // Forward the pick to the picker returned from the child policy.
476
474
  PickResult result = picker_->Pick(args);
@@ -481,7 +479,7 @@ LoadBalancingPolicy::PickResult XdsLb::EndpointPickerWrapper::Pick(
481
479
  // Record a call started.
482
480
  locality_stats_->AddCallStarted();
483
481
  // Intercept the recv_trailing_metadata op to record call completion.
484
- XdsClientStats::LocalityStats* locality_stats =
482
+ XdsClusterLocalityStats* locality_stats =
485
483
  locality_stats_->Ref(DEBUG_LOCATION, "LocalityStats+call").release();
486
484
  result.recv_trailing_metadata_ready =
487
485
  // Note: This callback does not run in either the control plane
@@ -503,7 +501,7 @@ XdsLb::PickResult XdsLb::LocalityPicker::Pick(PickArgs args) {
503
501
  // Handle drop.
504
502
  const std::string* drop_category;
505
503
  if (drop_config_->ShouldDrop(&drop_category)) {
506
- xds_policy_->client_stats_.AddCallDropped(*drop_category);
504
+ if (drop_stats_ != nullptr) drop_stats_->AddCallDropped(*drop_category);
507
505
  PickResult result;
508
506
  result.type = PickResult::PICK_COMPLETE;
509
507
  return result;
@@ -620,7 +618,7 @@ class XdsLb::EndpointWatcher : public XdsClient::EndpointWatcherInterface {
620
618
 
621
619
  ~EndpointWatcher() { xds_policy_.reset(DEBUG_LOCATION, "EndpointWatcher"); }
622
620
 
623
- void OnEndpointChanged(EdsUpdate update) override {
621
+ void OnEndpointChanged(XdsApi::EdsUpdate update) override {
624
622
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
625
623
  gpr_log(GPR_INFO, "[xdslb %p] Received EDS update from xds client",
626
624
  xds_policy_.get());
@@ -642,13 +640,13 @@ class XdsLb::EndpointWatcher : public XdsClient::EndpointWatcherInterface {
642
640
  xds_policy_.get(), drop_config_changed);
643
641
  }
644
642
  if (drop_config_changed) {
645
- xds_policy_->priority_list_.UpdateXdsPickerLocked();
643
+ xds_policy_->UpdateXdsPickerLocked();
646
644
  }
647
645
  return;
648
646
  }
649
647
  // Update the priority list.
650
648
  xds_policy_->priority_list_update_ = std::move(update.priority_list_update);
651
- xds_policy_->priority_list_.UpdateLocked();
649
+ xds_policy_->UpdatePrioritiesLocked(false /*update_locality_stats*/);
652
650
  }
653
651
 
654
652
  void OnError(grpc_error* error) override {
@@ -701,8 +699,7 @@ XdsLb::XdsLb(Args args)
701
699
  {GRPC_XDS_DEFAULT_LOCALITY_RETENTION_INTERVAL_MS, 0, INT_MAX})),
702
700
  locality_map_failover_timeout_ms_(grpc_channel_args_find_integer(
703
701
  args.args, GRPC_ARG_XDS_FAILOVER_TIMEOUT_MS,
704
- {GRPC_XDS_DEFAULT_FAILOVER_TIMEOUT_MS, 0, INT_MAX})),
705
- priority_list_(this) {
702
+ {GRPC_XDS_DEFAULT_FAILOVER_TIMEOUT_MS, 0, INT_MAX})) {
706
703
  if (xds_client_from_channel_ != nullptr &&
707
704
  GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
708
705
  gpr_log(GPR_INFO, "[xdslb %p] Using xds client %p from channel", this,
@@ -735,7 +732,8 @@ void XdsLb::ShutdownLocked() {
735
732
  }
736
733
  shutting_down_ = true;
737
734
  MaybeCancelFallbackAtStartupChecks();
738
- priority_list_.ShutdownLocked();
735
+ priorities_.clear();
736
+ drop_stats_.reset();
739
737
  if (fallback_policy_ != nullptr) {
740
738
  grpc_pollset_set_del_pollset_set(fallback_policy_->interested_parties(),
741
739
  interested_parties());
@@ -746,19 +744,15 @@ void XdsLb::ShutdownLocked() {
746
744
  }
747
745
  fallback_policy_.reset();
748
746
  pending_fallback_policy_.reset();
749
- // Cancel the endpoint watch here instead of in our dtor, because the
750
- // watcher holds a ref to us.
751
- xds_client()->CancelEndpointDataWatch(StringView(eds_service_name()),
752
- endpoint_watcher_);
753
- if (config_->lrs_load_reporting_server_name().has_value()) {
754
- // TODO(roth): We should pass the cluster name (in addition to the
755
- // eds_service_name) when adding the client stats. To do so, we need to
756
- // first find a way to plumb the cluster name down into this LB policy.
757
- xds_client()->RemoveClientStats(
758
- StringView(config_->lrs_load_reporting_server_name().value().c_str()),
759
- StringView(eds_service_name()), &client_stats_);
760
- }
761
- xds_client_from_channel_.reset();
747
+ // Cancel the endpoint watch here instead of in our dtor if we are using the
748
+ // XdsResolver, because the watcher holds a ref to us and we might not be
749
+ // destroying the Xds client leading to a situation where the Xds lb policy is
750
+ // never destroyed.
751
+ if (xds_client_from_channel_ != nullptr) {
752
+ xds_client()->CancelEndpointDataWatch(StringView(eds_service_name()),
753
+ endpoint_watcher_);
754
+ xds_client_from_channel_.reset();
755
+ }
762
756
  xds_client_.reset();
763
757
  }
764
758
 
@@ -771,7 +765,9 @@ void XdsLb::ResetBackoffLocked() {
771
765
  // LB policy, this is done via the resolver, so we don't need to do it
772
766
  // for xds_client_from_channel_ here.
773
767
  if (xds_client_ != nullptr) xds_client_->ResetBackoff();
774
- priority_list_.ResetBackoffLocked();
768
+ for (size_t i = 0; i < priorities_.size(); ++i) {
769
+ priorities_[i]->ResetBackoffLocked();
770
+ }
775
771
  if (fallback_policy_ != nullptr) {
776
772
  fallback_policy_->ResetBackoffLocked();
777
773
  }
@@ -795,8 +791,6 @@ void XdsLb::UpdateLocked(UpdateArgs args) {
795
791
  grpc_channel_args_destroy(args_);
796
792
  args_ = args.args;
797
793
  args.args = nullptr;
798
- // Update priority list.
799
- priority_list_.UpdateLocked();
800
794
  // Update the existing fallback policy. The fallback policy config and/or the
801
795
  // fallback addresses may be new.
802
796
  if (fallback_policy_ != nullptr) UpdateFallbackPolicyLocked();
@@ -823,6 +817,31 @@ void XdsLb::UpdateLocked(UpdateArgs args) {
823
817
  fallback_at_startup_checks_pending_ = true;
824
818
  grpc_timer_init(&lb_fallback_timer_, deadline, &lb_on_fallback_);
825
819
  }
820
+ // Update drop stats for load reporting if needed.
821
+ if (is_initial_update || config_->lrs_load_reporting_server_name() !=
822
+ old_config->lrs_load_reporting_server_name()) {
823
+ drop_stats_.reset();
824
+ if (config_->lrs_load_reporting_server_name().has_value()) {
825
+ drop_stats_ = xds_client()->AddClusterDropStats(
826
+ config_->lrs_load_reporting_server_name().value(),
827
+ // TODO(roth): We currently hard-code the assumption that
828
+ // cluster name and EDS service name are the same. Fix this
829
+ // as part of refectoring this LB policy.
830
+ eds_service_name(), eds_service_name());
831
+ }
832
+ }
833
+ // Update priority list.
834
+ // Note that this comes after updating drop_stats_, since we want that
835
+ // to be used by any new picker we create here.
836
+ // No need to do this on the initial update, since there won't be any
837
+ // priorities to update yet.
838
+ if (!is_initial_update) {
839
+ const bool update_locality_stats =
840
+ config_->lrs_load_reporting_server_name() !=
841
+ old_config->lrs_load_reporting_server_name() ||
842
+ strcmp(old_eds_service_name, eds_service_name()) != 0;
843
+ UpdatePrioritiesLocked(update_locality_stats);
844
+ }
826
845
  // Update endpoint watcher if needed.
827
846
  if (is_initial_update ||
828
847
  strcmp(old_eds_service_name, eds_service_name()) != 0) {
@@ -830,40 +849,12 @@ void XdsLb::UpdateLocked(UpdateArgs args) {
830
849
  xds_client()->CancelEndpointDataWatch(StringView(old_eds_service_name),
831
850
  endpoint_watcher_);
832
851
  }
833
- auto watcher =
834
- MakeUnique<EndpointWatcher>(Ref(DEBUG_LOCATION, "EndpointWatcher"));
852
+ auto watcher = absl::make_unique<EndpointWatcher>(
853
+ Ref(DEBUG_LOCATION, "EndpointWatcher"));
835
854
  endpoint_watcher_ = watcher.get();
836
855
  xds_client()->WatchEndpointData(StringView(eds_service_name()),
837
856
  std::move(watcher));
838
857
  }
839
- // Update load reporting if needed.
840
- // TODO(roth): Ideally, we should not collect any stats if load reporting
841
- // is disabled, which would require changing this code to recreate
842
- // all of the pickers whenever load reporting is enabled or disabled
843
- // here.
844
- if (is_initial_update ||
845
- (config_->lrs_load_reporting_server_name().has_value()) !=
846
- (old_config->lrs_load_reporting_server_name().has_value()) ||
847
- (config_->lrs_load_reporting_server_name().has_value() &&
848
- old_config->lrs_load_reporting_server_name().has_value() &&
849
- config_->lrs_load_reporting_server_name().value() !=
850
- old_config->lrs_load_reporting_server_name().value())) {
851
- if (old_config != nullptr &&
852
- old_config->lrs_load_reporting_server_name().has_value()) {
853
- xds_client()->RemoveClientStats(
854
- StringView(
855
- old_config->lrs_load_reporting_server_name().value().c_str()),
856
- StringView(old_eds_service_name), &client_stats_);
857
- }
858
- if (config_->lrs_load_reporting_server_name().has_value()) {
859
- // TODO(roth): We should pass the cluster name (in addition to the
860
- // eds_service_name) when adding the client stats. To do so, we need to
861
- // first find a way to plumb the cluster name down into this LB policy.
862
- xds_client()->AddClientStats(
863
- StringView(config_->lrs_load_reporting_server_name().value().c_str()),
864
- StringView(eds_service_name()), &client_stats_);
865
- }
866
- }
867
858
  }
868
859
 
869
860
  //
@@ -1043,21 +1034,22 @@ void XdsLb::MaybeExitFallbackMode() {
1043
1034
  }
1044
1035
 
1045
1036
  //
1046
- // XdsLb::PriorityList
1037
+ // priority list-related methods
1047
1038
  //
1048
1039
 
1049
- void XdsLb::PriorityList::UpdateLocked() {
1050
- const auto& priority_list_update = xds_policy_->priority_list_update_;
1040
+ void XdsLb::UpdatePrioritiesLocked(bool update_locality_stats) {
1051
1041
  // 1. Remove from the priority list the priorities that are not in the update.
1052
- DeactivatePrioritiesLowerThan(priority_list_update.LowestPriority());
1042
+ DeactivatePrioritiesLowerThan(priority_list_update_.LowestPriority());
1053
1043
  // 2. Update all the existing priorities.
1054
1044
  for (uint32_t priority = 0; priority < priorities_.size(); ++priority) {
1055
1045
  LocalityMap* locality_map = priorities_[priority].get();
1056
- const auto* locality_map_update = priority_list_update.Find(priority);
1046
+ const auto* locality_map_update = priority_list_update_.Find(priority);
1047
+ // If we have more current priorities than exist in the update, stop here.
1048
+ if (locality_map_update == nullptr) break;
1057
1049
  // Propagate locality_map_update.
1058
1050
  // TODO(juanlishen): Find a clean way to skip duplicate update for a
1059
1051
  // priority.
1060
- locality_map->UpdateLocked(*locality_map_update);
1052
+ locality_map->UpdateLocked(*locality_map_update, update_locality_stats);
1061
1053
  }
1062
1054
  // 3. Only create a new locality map if all the existing ones have failed.
1063
1055
  if (priorities_.empty() ||
@@ -1069,54 +1061,51 @@ void XdsLb::PriorityList::UpdateLocked() {
1069
1061
  // to be created.
1070
1062
  MaybeCreateLocalityMapLocked(new_priority);
1071
1063
  }
1072
- }
1073
-
1074
- void XdsLb::PriorityList::ResetBackoffLocked() {
1075
- for (size_t i = 0; i < priorities_.size(); ++i) {
1076
- priorities_[i]->ResetBackoffLocked();
1064
+ // 4. If we updated locality stats and we already have at least one
1065
+ // priority, update the picker to start using the new stats object(s).
1066
+ if (update_locality_stats && !priorities_.empty()) {
1067
+ UpdateXdsPickerLocked();
1077
1068
  }
1078
1069
  }
1079
1070
 
1080
- void XdsLb::PriorityList::ShutdownLocked() { priorities_.clear(); }
1081
-
1082
- void XdsLb::PriorityList::UpdateXdsPickerLocked() {
1071
+ void XdsLb::UpdateXdsPickerLocked() {
1083
1072
  // If we are in fallback mode, don't generate an xds picker from localities.
1084
- if (xds_policy_->fallback_policy_ != nullptr) return;
1085
- if (current_priority() == UINT32_MAX) {
1073
+ if (fallback_policy_ != nullptr) return;
1074
+ if (current_priority_ == UINT32_MAX) {
1086
1075
  grpc_error* error = grpc_error_set_int(
1087
1076
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready locality map"),
1088
1077
  GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
1089
- xds_policy_->channel_control_helper()->UpdateState(
1078
+ channel_control_helper()->UpdateState(
1090
1079
  GRPC_CHANNEL_TRANSIENT_FAILURE,
1091
- MakeUnique<TransientFailurePicker>(error));
1080
+ absl::make_unique<TransientFailurePicker>(error));
1092
1081
  return;
1093
1082
  }
1094
1083
  priorities_[current_priority_]->UpdateXdsPickerLocked();
1095
1084
  }
1096
1085
 
1097
- void XdsLb::PriorityList::MaybeCreateLocalityMapLocked(uint32_t priority) {
1086
+ void XdsLb::MaybeCreateLocalityMapLocked(uint32_t priority) {
1098
1087
  // Exhausted priorities in the update.
1099
- if (!priority_list_update().Contains(priority)) return;
1100
- auto new_locality_map = new LocalityMap(
1101
- xds_policy_->Ref(DEBUG_LOCATION, "LocalityMap"), priority);
1088
+ if (!priority_list_update_.Contains(priority)) return;
1089
+ auto new_locality_map =
1090
+ new LocalityMap(Ref(DEBUG_LOCATION, "LocalityMap"), priority);
1102
1091
  priorities_.emplace_back(OrphanablePtr<LocalityMap>(new_locality_map));
1103
- new_locality_map->UpdateLocked(*priority_list_update().Find(priority));
1092
+ new_locality_map->UpdateLocked(*priority_list_update_.Find(priority),
1093
+ false /*update_locality_stats*/);
1104
1094
  }
1105
1095
 
1106
- void XdsLb::PriorityList::FailoverOnConnectionFailureLocked() {
1096
+ void XdsLb::FailoverOnConnectionFailureLocked() {
1107
1097
  const uint32_t failed_priority = LowestPriority();
1108
1098
  // If we're failing over from the lowest priority, report TRANSIENT_FAILURE.
1109
- if (failed_priority == priority_list_update().LowestPriority()) {
1099
+ if (failed_priority == priority_list_update_.LowestPriority()) {
1110
1100
  UpdateXdsPickerLocked();
1111
1101
  }
1112
1102
  MaybeCreateLocalityMapLocked(failed_priority + 1);
1113
1103
  }
1114
1104
 
1115
- void XdsLb::PriorityList::FailoverOnDisconnectionLocked(
1116
- uint32_t failed_priority) {
1105
+ void XdsLb::FailoverOnDisconnectionLocked(uint32_t failed_priority) {
1117
1106
  current_priority_ = UINT32_MAX;
1118
1107
  for (uint32_t next_priority = failed_priority + 1;
1119
- next_priority <= priority_list_update().LowestPriority();
1108
+ next_priority <= priority_list_update_.LowestPriority();
1120
1109
  ++next_priority) {
1121
1110
  if (!Contains(next_priority)) {
1122
1111
  MaybeCreateLocalityMapLocked(next_priority);
@@ -1126,17 +1115,17 @@ void XdsLb::PriorityList::FailoverOnDisconnectionLocked(
1126
1115
  }
1127
1116
  }
1128
1117
 
1129
- void XdsLb::PriorityList::SwitchToHigherPriorityLocked(uint32_t priority) {
1118
+ void XdsLb::SwitchToHigherPriorityLocked(uint32_t priority) {
1130
1119
  current_priority_ = priority;
1131
1120
  DeactivatePrioritiesLowerThan(current_priority_);
1132
1121
  UpdateXdsPickerLocked();
1133
1122
  }
1134
1123
 
1135
- void XdsLb::PriorityList::DeactivatePrioritiesLowerThan(uint32_t priority) {
1124
+ void XdsLb::DeactivatePrioritiesLowerThan(uint32_t priority) {
1136
1125
  if (priorities_.empty()) return;
1137
1126
  // Deactivate the locality maps from the lowest priority.
1138
1127
  for (uint32_t p = LowestPriority(); p > priority; --p) {
1139
- if (xds_policy_->locality_retention_interval_ms_ == 0) {
1128
+ if (locality_retention_interval_ms_ == 0) {
1140
1129
  priorities_.pop_back();
1141
1130
  } else {
1142
1131
  priorities_[p]->DeactivateLocked();
@@ -1144,8 +1133,7 @@ void XdsLb::PriorityList::DeactivatePrioritiesLowerThan(uint32_t priority) {
1144
1133
  }
1145
1134
  }
1146
1135
 
1147
- OrphanablePtr<XdsLb::PriorityList::LocalityMap::Locality>
1148
- XdsLb::PriorityList::ExtractLocalityLocked(
1136
+ OrphanablePtr<XdsLb::LocalityMap::Locality> XdsLb::ExtractLocalityLocked(
1149
1137
  const RefCountedPtr<XdsLocalityName>& name, uint32_t exclude_priority) {
1150
1138
  for (uint32_t priority = 0; priority < priorities_.size(); ++priority) {
1151
1139
  if (priority == exclude_priority) continue;
@@ -1157,11 +1145,11 @@ XdsLb::PriorityList::ExtractLocalityLocked(
1157
1145
  }
1158
1146
 
1159
1147
  //
1160
- // XdsLb::PriorityList::LocalityMap
1148
+ // XdsLb::LocalityMap
1161
1149
  //
1162
1150
 
1163
- XdsLb::PriorityList::LocalityMap::LocalityMap(RefCountedPtr<XdsLb> xds_policy,
1164
- uint32_t priority)
1151
+ XdsLb::LocalityMap::LocalityMap(RefCountedPtr<XdsLb> xds_policy,
1152
+ uint32_t priority)
1165
1153
  : xds_policy_(std::move(xds_policy)), priority_(priority) {
1166
1154
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1167
1155
  gpr_log(GPR_INFO, "[xdslb %p] Creating priority %" PRIu32,
@@ -1179,13 +1167,15 @@ XdsLb::PriorityList::LocalityMap::LocalityMap(RefCountedPtr<XdsLb> xds_policy,
1179
1167
  // This is the first locality map ever created, report CONNECTING.
1180
1168
  if (priority_ == 0) {
1181
1169
  xds_policy_->channel_control_helper()->UpdateState(
1182
- GRPC_CHANNEL_CONNECTING, MakeUnique<QueuePicker>(xds_policy_->Ref(
1183
- DEBUG_LOCATION, "QueuePicker")));
1170
+ GRPC_CHANNEL_CONNECTING,
1171
+ absl::make_unique<QueuePicker>(
1172
+ xds_policy_->Ref(DEBUG_LOCATION, "QueuePicker")));
1184
1173
  }
1185
1174
  }
1186
1175
 
1187
- void XdsLb::PriorityList::LocalityMap::UpdateLocked(
1188
- const XdsPriorityListUpdate::LocalityMap& locality_map_update) {
1176
+ void XdsLb::LocalityMap::UpdateLocked(
1177
+ const XdsApi::PriorityListUpdate::LocalityMap& locality_map_update,
1178
+ bool update_locality_stats) {
1189
1179
  if (xds_policy_->shutting_down_) return;
1190
1180
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1191
1181
  gpr_log(GPR_INFO, "[xdslb %p] Start Updating priority %" PRIu32,
@@ -1216,7 +1206,7 @@ void XdsLb::PriorityList::LocalityMap::UpdateLocked(
1216
1206
  OrphanablePtr<Locality>& locality = localities_[name];
1217
1207
  if (locality == nullptr) {
1218
1208
  // Move from another locality map if possible.
1219
- locality = priority_list()->ExtractLocalityLocked(name, priority_);
1209
+ locality = xds_policy_->ExtractLocalityLocked(name, priority_);
1220
1210
  if (locality != nullptr) {
1221
1211
  locality->set_locality_map(
1222
1212
  Ref(DEBUG_LOCATION, "LocalityMap+Locality_move"));
@@ -1228,39 +1218,38 @@ void XdsLb::PriorityList::LocalityMap::UpdateLocked(
1228
1218
  // Keep a copy of serverlist in the update so that we can compare it
1229
1219
  // with the future ones.
1230
1220
  locality->UpdateLocked(locality_update.lb_weight,
1231
- locality_update.serverlist);
1221
+ locality_update.serverlist, update_locality_stats);
1232
1222
  }
1233
1223
  }
1234
1224
 
1235
- void XdsLb::PriorityList::LocalityMap::ResetBackoffLocked() {
1225
+ void XdsLb::LocalityMap::ResetBackoffLocked() {
1236
1226
  for (auto& p : localities_) p.second->ResetBackoffLocked();
1237
1227
  }
1238
1228
 
1239
- void XdsLb::PriorityList::LocalityMap::UpdateXdsPickerLocked() {
1229
+ void XdsLb::LocalityMap::UpdateXdsPickerLocked() {
1240
1230
  // Construct a new xds picker which maintains a map of all locality pickers
1241
1231
  // that are ready. Each locality is represented by a portion of the range
1242
1232
  // proportional to its weight, such that the total range is the sum of the
1243
1233
  // weights of all localities.
1244
1234
  LocalityPicker::PickerList picker_list;
1245
1235
  uint32_t end = 0;
1246
- for (const auto& p : localities_) {
1236
+ for (auto& p : localities_) {
1247
1237
  const auto& locality_name = p.first;
1248
- const Locality* locality = p.second.get();
1238
+ Locality* locality = p.second.get();
1249
1239
  // Skip the localities that are not in the latest locality map update.
1250
1240
  if (!locality_map_update()->Contains(locality_name)) continue;
1251
1241
  if (locality->connectivity_state() != GRPC_CHANNEL_READY) continue;
1252
1242
  end += locality->weight();
1253
- picker_list.push_back(std::make_pair(end, locality->picker_wrapper()));
1243
+ picker_list.push_back(
1244
+ std::make_pair(end, locality->GetLoadReportingPicker()));
1254
1245
  }
1255
1246
  xds_policy()->channel_control_helper()->UpdateState(
1256
1247
  GRPC_CHANNEL_READY,
1257
- grpc_core::MakeUnique<LocalityPicker>(
1258
- xds_policy_->Ref(DEBUG_LOCATION, "LocalityPicker"),
1259
- std::move(picker_list)));
1248
+ absl::make_unique<LocalityPicker>(xds_policy(), std::move(picker_list)));
1260
1249
  }
1261
1250
 
1262
- OrphanablePtr<XdsLb::PriorityList::LocalityMap::Locality>
1263
- XdsLb::PriorityList::LocalityMap::ExtractLocalityLocked(
1251
+ OrphanablePtr<XdsLb::LocalityMap::Locality>
1252
+ XdsLb::LocalityMap::ExtractLocalityLocked(
1264
1253
  const RefCountedPtr<XdsLocalityName>& name) {
1265
1254
  for (auto iter = localities_.begin(); iter != localities_.end(); ++iter) {
1266
1255
  const auto& name_in_map = iter->first;
@@ -1273,7 +1262,7 @@ XdsLb::PriorityList::LocalityMap::ExtractLocalityLocked(
1273
1262
  return nullptr;
1274
1263
  }
1275
1264
 
1276
- void XdsLb::PriorityList::LocalityMap::DeactivateLocked() {
1265
+ void XdsLb::LocalityMap::DeactivateLocked() {
1277
1266
  // If already deactivated, don't do it again.
1278
1267
  if (delayed_removal_timer_callback_pending_) return;
1279
1268
  MaybeCancelFailoverTimerLocked();
@@ -1294,24 +1283,24 @@ void XdsLb::PriorityList::LocalityMap::DeactivateLocked() {
1294
1283
  delayed_removal_timer_callback_pending_ = true;
1295
1284
  }
1296
1285
 
1297
- bool XdsLb::PriorityList::LocalityMap::MaybeReactivateLocked() {
1286
+ bool XdsLb::LocalityMap::MaybeReactivateLocked() {
1298
1287
  // Don't reactivate a priority that is not higher than the current one.
1299
- if (priority_ >= priority_list()->current_priority()) return false;
1288
+ if (priority_ >= xds_policy_->current_priority_) return false;
1300
1289
  // Reactivate this priority by cancelling deletion timer.
1301
1290
  if (delayed_removal_timer_callback_pending_) {
1302
1291
  grpc_timer_cancel(&delayed_removal_timer_);
1303
1292
  }
1304
1293
  // Switch to this higher priority if it's READY.
1305
1294
  if (connectivity_state_ != GRPC_CHANNEL_READY) return false;
1306
- priority_list()->SwitchToHigherPriorityLocked(priority_);
1295
+ xds_policy_->SwitchToHigherPriorityLocked(priority_);
1307
1296
  return true;
1308
1297
  }
1309
1298
 
1310
- void XdsLb::PriorityList::LocalityMap::MaybeCancelFailoverTimerLocked() {
1299
+ void XdsLb::LocalityMap::MaybeCancelFailoverTimerLocked() {
1311
1300
  if (failover_timer_callback_pending_) grpc_timer_cancel(&failover_timer_);
1312
1301
  }
1313
1302
 
1314
- void XdsLb::PriorityList::LocalityMap::Orphan() {
1303
+ void XdsLb::LocalityMap::Orphan() {
1315
1304
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1316
1305
  gpr_log(GPR_INFO, "[xdslb %p] Priority %" PRIu32 " orphaned.", xds_policy(),
1317
1306
  priority_);
@@ -1324,11 +1313,11 @@ void XdsLb::PriorityList::LocalityMap::Orphan() {
1324
1313
  Unref(DEBUG_LOCATION, "LocalityMap+Orphan");
1325
1314
  }
1326
1315
 
1327
- void XdsLb::PriorityList::LocalityMap::OnLocalityStateUpdateLocked() {
1316
+ void XdsLb::LocalityMap::OnLocalityStateUpdateLocked() {
1328
1317
  UpdateConnectivityStateLocked();
1329
1318
  // Ignore priorities not in priority_list_update.
1330
1319
  if (!priority_list_update().Contains(priority_)) return;
1331
- const uint32_t current_priority = priority_list()->current_priority();
1320
+ const uint32_t current_priority = xds_policy_->current_priority_;
1332
1321
  // Ignore lower-than-current priorities.
1333
1322
  if (priority_ > current_priority) return;
1334
1323
  // Maybe update fallback state.
@@ -1342,13 +1331,13 @@ void XdsLb::PriorityList::LocalityMap::OnLocalityStateUpdateLocked() {
1342
1331
  if (connectivity_state_ == GRPC_CHANNEL_READY) {
1343
1332
  MaybeCancelFailoverTimerLocked();
1344
1333
  // If a higher-than-current priority becomes READY, switch to use it.
1345
- priority_list()->SwitchToHigherPriorityLocked(priority_);
1334
+ xds_policy_->SwitchToHigherPriorityLocked(priority_);
1346
1335
  } else if (connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE) {
1347
1336
  // If a higher-than-current priority becomes TRANSIENT_FAILURE, only
1348
1337
  // handle it if it's the priority that is still in failover timeout.
1349
1338
  if (failover_timer_callback_pending_) {
1350
1339
  MaybeCancelFailoverTimerLocked();
1351
- priority_list()->FailoverOnConnectionFailureLocked();
1340
+ xds_policy_->FailoverOnConnectionFailureLocked();
1352
1341
  }
1353
1342
  }
1354
1343
  return;
@@ -1356,7 +1345,7 @@ void XdsLb::PriorityList::LocalityMap::OnLocalityStateUpdateLocked() {
1356
1345
  // Update is for current priority.
1357
1346
  if (connectivity_state_ != GRPC_CHANNEL_READY) {
1358
1347
  // Fail over if it's no longer READY.
1359
- priority_list()->FailoverOnDisconnectionLocked(priority_);
1348
+ xds_policy_->FailoverOnDisconnectionLocked(priority_);
1360
1349
  }
1361
1350
  // At this point, one of the following things has happened to the current
1362
1351
  // priority.
@@ -1364,10 +1353,10 @@ void XdsLb::PriorityList::LocalityMap::OnLocalityStateUpdateLocked() {
1364
1353
  // 2. It changed to a lower priority due to failover.
1365
1354
  // 3. It became invalid because failover didn't yield a READY priority.
1366
1355
  // In any case, update the xds picker.
1367
- priority_list()->UpdateXdsPickerLocked();
1356
+ xds_policy_->UpdateXdsPickerLocked();
1368
1357
  }
1369
1358
 
1370
- void XdsLb::PriorityList::LocalityMap::UpdateConnectivityStateLocked() {
1359
+ void XdsLb::LocalityMap::UpdateConnectivityStateLocked() {
1371
1360
  size_t num_ready = 0;
1372
1361
  size_t num_connecting = 0;
1373
1362
  size_t num_idle = 0;
@@ -1415,8 +1404,7 @@ void XdsLb::PriorityList::LocalityMap::UpdateConnectivityStateLocked() {
1415
1404
  }
1416
1405
  }
1417
1406
 
1418
- void XdsLb::PriorityList::LocalityMap::OnDelayedRemovalTimer(
1419
- void* arg, grpc_error* error) {
1407
+ void XdsLb::LocalityMap::OnDelayedRemovalTimer(void* arg, grpc_error* error) {
1420
1408
  LocalityMap* self = static_cast<LocalityMap*>(arg);
1421
1409
  self->xds_policy_->combiner()->Run(
1422
1410
  GRPC_CLOSURE_INIT(&self->on_delayed_removal_timer_,
@@ -1424,14 +1412,13 @@ void XdsLb::PriorityList::LocalityMap::OnDelayedRemovalTimer(
1424
1412
  GRPC_ERROR_REF(error));
1425
1413
  }
1426
1414
 
1427
- void XdsLb::PriorityList::LocalityMap::OnDelayedRemovalTimerLocked(
1428
- void* arg, grpc_error* error) {
1415
+ void XdsLb::LocalityMap::OnDelayedRemovalTimerLocked(void* arg,
1416
+ grpc_error* error) {
1429
1417
  LocalityMap* self = static_cast<LocalityMap*>(arg);
1430
1418
  self->delayed_removal_timer_callback_pending_ = false;
1431
1419
  if (error == GRPC_ERROR_NONE && !self->xds_policy_->shutting_down_) {
1432
- auto* priority_list = self->priority_list();
1433
1420
  const bool keep = self->priority_list_update().Contains(self->priority_) &&
1434
- self->priority_ <= priority_list->current_priority();
1421
+ self->priority_ <= self->xds_policy_->current_priority_;
1435
1422
  if (!keep) {
1436
1423
  // This check is to make sure we always delete the locality maps from
1437
1424
  // the lowest priority even if the closures of the back-to-back timers
@@ -1440,8 +1427,8 @@ void XdsLb::PriorityList::LocalityMap::OnDelayedRemovalTimerLocked(
1440
1427
  // deactivated locality maps when out-of-order closures are run.
1441
1428
  // TODO(juanlishen): Check the timer implementation to see if this
1442
1429
  // defense is necessary.
1443
- if (self->priority_ == priority_list->LowestPriority()) {
1444
- priority_list->priorities_.pop_back();
1430
+ if (self->priority_ == self->xds_policy_->LowestPriority()) {
1431
+ self->xds_policy_->priorities_.pop_back();
1445
1432
  } else {
1446
1433
  gpr_log(GPR_ERROR,
1447
1434
  "[xdslb %p] Priority %" PRIu32
@@ -1454,8 +1441,7 @@ void XdsLb::PriorityList::LocalityMap::OnDelayedRemovalTimerLocked(
1454
1441
  self->Unref(DEBUG_LOCATION, "LocalityMap+timer");
1455
1442
  }
1456
1443
 
1457
- void XdsLb::PriorityList::LocalityMap::OnFailoverTimer(void* arg,
1458
- grpc_error* error) {
1444
+ void XdsLb::LocalityMap::OnFailoverTimer(void* arg, grpc_error* error) {
1459
1445
  LocalityMap* self = static_cast<LocalityMap*>(arg);
1460
1446
  self->xds_policy_->combiner()->Run(
1461
1447
  GRPC_CLOSURE_INIT(&self->on_failover_timer_, OnFailoverTimerLocked, self,
@@ -1463,31 +1449,31 @@ void XdsLb::PriorityList::LocalityMap::OnFailoverTimer(void* arg,
1463
1449
  GRPC_ERROR_REF(error));
1464
1450
  }
1465
1451
 
1466
- void XdsLb::PriorityList::LocalityMap::OnFailoverTimerLocked(
1467
- void* arg, grpc_error* error) {
1452
+ void XdsLb::LocalityMap::OnFailoverTimerLocked(void* arg, grpc_error* error) {
1468
1453
  LocalityMap* self = static_cast<LocalityMap*>(arg);
1469
1454
  self->failover_timer_callback_pending_ = false;
1470
1455
  if (error == GRPC_ERROR_NONE && !self->xds_policy_->shutting_down_) {
1471
- self->priority_list()->FailoverOnConnectionFailureLocked();
1456
+ self->xds_policy_->FailoverOnConnectionFailureLocked();
1472
1457
  }
1473
1458
  self->Unref(DEBUG_LOCATION, "LocalityMap+OnFailoverTimerLocked");
1474
1459
  }
1475
1460
 
1476
1461
  //
1477
- // XdsLb::PriorityList::LocalityMap::Locality
1462
+ // XdsLb::LocalityMap::Locality
1478
1463
  //
1479
1464
 
1480
- XdsLb::PriorityList::LocalityMap::Locality::Locality(
1481
- RefCountedPtr<LocalityMap> locality_map,
1482
- RefCountedPtr<XdsLocalityName> name)
1465
+ XdsLb::LocalityMap::Locality::Locality(RefCountedPtr<LocalityMap> locality_map,
1466
+ RefCountedPtr<XdsLocalityName> name)
1483
1467
  : locality_map_(std::move(locality_map)), name_(std::move(name)) {
1484
1468
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1485
1469
  gpr_log(GPR_INFO, "[xdslb %p] created Locality %p for %s", xds_policy(),
1486
1470
  this, name_->AsHumanReadableString());
1487
1471
  }
1472
+ // Initialize locality stats if load reporting is enabled.
1473
+ UpdateLocalityStats();
1488
1474
  }
1489
1475
 
1490
- XdsLb::PriorityList::LocalityMap::Locality::~Locality() {
1476
+ XdsLb::LocalityMap::Locality::~Locality() {
1491
1477
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1492
1478
  gpr_log(GPR_INFO, "[xdslb %p] Locality %p %s: destroying locality",
1493
1479
  xds_policy(), this, name_->AsHumanReadableString());
@@ -1495,8 +1481,20 @@ XdsLb::PriorityList::LocalityMap::Locality::~Locality() {
1495
1481
  locality_map_.reset(DEBUG_LOCATION, "Locality");
1496
1482
  }
1497
1483
 
1498
- grpc_channel_args*
1499
- XdsLb::PriorityList::LocalityMap::Locality::CreateChildPolicyArgsLocked(
1484
+ void XdsLb::LocalityMap::Locality::UpdateLocalityStats() {
1485
+ stats_.reset();
1486
+ if (xds_policy()->config_->lrs_load_reporting_server_name().has_value()) {
1487
+ stats_ = xds_policy()->xds_client()->AddClusterLocalityStats(
1488
+ xds_policy()->config_->lrs_load_reporting_server_name().value(),
1489
+ // TODO(roth): We currently hard-code the assumption that
1490
+ // cluster name and EDS service name are the same. Fix this
1491
+ // as part of refectoring this LB policy.
1492
+ xds_policy()->eds_service_name(), xds_policy()->eds_service_name(),
1493
+ name_);
1494
+ }
1495
+ }
1496
+
1497
+ grpc_channel_args* XdsLb::LocalityMap::Locality::CreateChildPolicyArgsLocked(
1500
1498
  const grpc_channel_args* args_in) {
1501
1499
  const grpc_arg args_to_add[] = {
1502
1500
  // A channel arg indicating if the target is a backend inferred from a
@@ -1514,7 +1512,7 @@ XdsLb::PriorityList::LocalityMap::Locality::CreateChildPolicyArgsLocked(
1514
1512
  }
1515
1513
 
1516
1514
  OrphanablePtr<LoadBalancingPolicy>
1517
- XdsLb::PriorityList::LocalityMap::Locality::CreateChildPolicyLocked(
1515
+ XdsLb::LocalityMap::Locality::CreateChildPolicyLocked(
1518
1516
  const char* name, const grpc_channel_args* args) {
1519
1517
  Helper* helper = new Helper(this->Ref(DEBUG_LOCATION, "Helper"));
1520
1518
  LoadBalancingPolicy::Args lb_policy_args;
@@ -1546,14 +1544,17 @@ XdsLb::PriorityList::LocalityMap::Locality::CreateChildPolicyLocked(
1546
1544
  return lb_policy;
1547
1545
  }
1548
1546
 
1549
- void XdsLb::PriorityList::LocalityMap::Locality::UpdateLocked(
1550
- uint32_t locality_weight, ServerAddressList serverlist) {
1547
+ void XdsLb::LocalityMap::Locality::UpdateLocked(uint32_t locality_weight,
1548
+ ServerAddressList serverlist,
1549
+ bool update_locality_stats) {
1551
1550
  if (xds_policy()->shutting_down_) return;
1552
1551
  // Update locality weight.
1553
1552
  weight_ = locality_weight;
1554
1553
  if (delayed_removal_timer_callback_pending_) {
1555
1554
  grpc_timer_cancel(&delayed_removal_timer_);
1556
1555
  }
1556
+ // Update locality stats.
1557
+ if (update_locality_stats) UpdateLocalityStats();
1557
1558
  // Construct update args.
1558
1559
  UpdateArgs update_args;
1559
1560
  update_args.addresses = std::move(serverlist);
@@ -1656,11 +1657,12 @@ void XdsLb::PriorityList::LocalityMap::Locality::UpdateLocked(
1656
1657
  policy_to_update->UpdateLocked(std::move(update_args));
1657
1658
  }
1658
1659
 
1659
- void XdsLb::PriorityList::LocalityMap::Locality::ShutdownLocked() {
1660
+ void XdsLb::LocalityMap::Locality::ShutdownLocked() {
1660
1661
  if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) {
1661
1662
  gpr_log(GPR_INFO, "[xdslb %p] Locality %p %s: shutting down locality",
1662
1663
  xds_policy(), this, name_->AsHumanReadableString());
1663
1664
  }
1665
+ stats_.reset();
1664
1666
  // Remove the child policy's interested_parties pollset_set from the
1665
1667
  // xDS policy.
1666
1668
  grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
@@ -1674,6 +1676,7 @@ void XdsLb::PriorityList::LocalityMap::Locality::ShutdownLocked() {
1674
1676
  }
1675
1677
  // Drop our ref to the child's picker, in case it's holding a ref to
1676
1678
  // the child.
1679
+ load_reporting_picker_.reset();
1677
1680
  picker_wrapper_.reset();
1678
1681
  if (delayed_removal_timer_callback_pending_) {
1679
1682
  grpc_timer_cancel(&delayed_removal_timer_);
@@ -1681,19 +1684,19 @@ void XdsLb::PriorityList::LocalityMap::Locality::ShutdownLocked() {
1681
1684
  shutdown_ = true;
1682
1685
  }
1683
1686
 
1684
- void XdsLb::PriorityList::LocalityMap::Locality::ResetBackoffLocked() {
1687
+ void XdsLb::LocalityMap::Locality::ResetBackoffLocked() {
1685
1688
  child_policy_->ResetBackoffLocked();
1686
1689
  if (pending_child_policy_ != nullptr) {
1687
1690
  pending_child_policy_->ResetBackoffLocked();
1688
1691
  }
1689
1692
  }
1690
1693
 
1691
- void XdsLb::PriorityList::LocalityMap::Locality::Orphan() {
1694
+ void XdsLb::LocalityMap::Locality::Orphan() {
1692
1695
  ShutdownLocked();
1693
1696
  Unref();
1694
1697
  }
1695
1698
 
1696
- void XdsLb::PriorityList::LocalityMap::Locality::DeactivateLocked() {
1699
+ void XdsLb::LocalityMap::Locality::DeactivateLocked() {
1697
1700
  // If already deactivated, don't do that again.
1698
1701
  if (weight_ == 0) return;
1699
1702
  // Set the locality weight to 0 so that future xds picker won't contain this
@@ -1710,8 +1713,8 @@ void XdsLb::PriorityList::LocalityMap::Locality::DeactivateLocked() {
1710
1713
  delayed_removal_timer_callback_pending_ = true;
1711
1714
  }
1712
1715
 
1713
- void XdsLb::PriorityList::LocalityMap::Locality::OnDelayedRemovalTimer(
1714
- void* arg, grpc_error* error) {
1716
+ void XdsLb::LocalityMap::Locality::OnDelayedRemovalTimer(void* arg,
1717
+ grpc_error* error) {
1715
1718
  Locality* self = static_cast<Locality*>(arg);
1716
1719
  self->xds_policy()->combiner()->Run(
1717
1720
  GRPC_CLOSURE_INIT(&self->on_delayed_removal_timer_,
@@ -1719,7 +1722,7 @@ void XdsLb::PriorityList::LocalityMap::Locality::OnDelayedRemovalTimer(
1719
1722
  GRPC_ERROR_REF(error));
1720
1723
  }
1721
1724
 
1722
- void XdsLb::PriorityList::LocalityMap::Locality::OnDelayedRemovalTimerLocked(
1725
+ void XdsLb::LocalityMap::Locality::OnDelayedRemovalTimerLocked(
1723
1726
  void* arg, grpc_error* error) {
1724
1727
  Locality* self = static_cast<Locality*>(arg);
1725
1728
  self->delayed_removal_timer_callback_pending_ = false;
@@ -1730,23 +1733,21 @@ void XdsLb::PriorityList::LocalityMap::Locality::OnDelayedRemovalTimerLocked(
1730
1733
  }
1731
1734
 
1732
1735
  //
1733
- // XdsLb::Locality::Helper
1736
+ // XdsLb::LocalityMap::Locality::Helper
1734
1737
  //
1735
1738
 
1736
- bool XdsLb::PriorityList::LocalityMap::Locality::Helper::CalledByPendingChild()
1737
- const {
1739
+ bool XdsLb::LocalityMap::Locality::Helper::CalledByPendingChild() const {
1738
1740
  GPR_ASSERT(child_ != nullptr);
1739
1741
  return child_ == locality_->pending_child_policy_.get();
1740
1742
  }
1741
1743
 
1742
- bool XdsLb::PriorityList::LocalityMap::Locality::Helper::CalledByCurrentChild()
1743
- const {
1744
+ bool XdsLb::LocalityMap::Locality::Helper::CalledByCurrentChild() const {
1744
1745
  GPR_ASSERT(child_ != nullptr);
1745
1746
  return child_ == locality_->child_policy_.get();
1746
1747
  }
1747
1748
 
1748
1749
  RefCountedPtr<SubchannelInterface>
1749
- XdsLb::PriorityList::LocalityMap::Locality::Helper::CreateSubchannel(
1750
+ XdsLb::LocalityMap::Locality::Helper::CreateSubchannel(
1750
1751
  const grpc_channel_args& args) {
1751
1752
  if (locality_->xds_policy()->shutting_down_ ||
1752
1753
  (!CalledByPendingChild() && !CalledByCurrentChild())) {
@@ -1756,7 +1757,7 @@ XdsLb::PriorityList::LocalityMap::Locality::Helper::CreateSubchannel(
1756
1757
  args);
1757
1758
  }
1758
1759
 
1759
- void XdsLb::PriorityList::LocalityMap::Locality::Helper::UpdateState(
1760
+ void XdsLb::LocalityMap::Locality::Helper::UpdateState(
1760
1761
  grpc_connectivity_state state, std::unique_ptr<SubchannelPicker> picker) {
1761
1762
  if (locality_->xds_policy()->shutting_down_) return;
1762
1763
  // If this request is from the pending child policy, ignore it until
@@ -1778,22 +1779,16 @@ void XdsLb::PriorityList::LocalityMap::Locality::Helper::UpdateState(
1778
1779
  // This request is from an outdated child, so ignore it.
1779
1780
  return;
1780
1781
  }
1781
- // Cache the picker and its state in the locality.
1782
- // TODO(roth): If load reporting is not configured, we should ideally
1783
- // pass a null LocalityStats ref to the EndpointPickerWrapper and have it
1784
- // not collect any stats, since they're not going to be used. This would
1785
- // require recreating all of the pickers whenever we get a config update.
1786
- locality_->picker_wrapper_ = MakeRefCounted<EndpointPickerWrapper>(
1787
- std::move(picker),
1788
- locality_->xds_policy()->client_stats_.FindLocalityStats(
1789
- locality_->name_));
1782
+ // Cache the state and picker in the locality.
1790
1783
  locality_->connectivity_state_ = state;
1784
+ locality_->picker_wrapper_ =
1785
+ MakeRefCounted<RefCountedEndpointPicker>(std::move(picker));
1791
1786
  // Notify the locality map.
1792
1787
  locality_->locality_map_->OnLocalityStateUpdateLocked();
1793
1788
  }
1794
1789
 
1795
- void XdsLb::PriorityList::LocalityMap::Locality::Helper::AddTraceEvent(
1796
- TraceSeverity severity, StringView message) {
1790
+ void XdsLb::LocalityMap::Locality::Helper::AddTraceEvent(TraceSeverity severity,
1791
+ StringView message) {
1797
1792
  if (locality_->xds_policy()->shutting_down_ ||
1798
1793
  (!CalledByPendingChild() && !CalledByCurrentChild())) {
1799
1794
  return;
@@ -1816,9 +1811,9 @@ class XdsFactory : public LoadBalancingPolicyFactory {
1816
1811
  const char* name() const override { return kXds; }
1817
1812
 
1818
1813
  RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
1819
- const grpc_json* json, grpc_error** error) const override {
1814
+ const Json& json, grpc_error** error) const override {
1820
1815
  GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
1821
- if (json == nullptr) {
1816
+ if (json.type() == Json::Type::JSON_NULL) {
1822
1817
  // xds was mentioned as a policy in the deprecated loadBalancingPolicy
1823
1818
  // field or in the client API.
1824
1819
  *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -1826,70 +1821,66 @@ class XdsFactory : public LoadBalancingPolicyFactory {
1826
1821
  "Please use loadBalancingConfig field of service config instead.");
1827
1822
  return nullptr;
1828
1823
  }
1829
- GPR_DEBUG_ASSERT(strcmp(json->key, name()) == 0);
1830
- InlinedVector<grpc_error*, 3> error_list;
1824
+ std::vector<grpc_error*> error_list;
1825
+ // Child policy.
1831
1826
  RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
1827
+ auto it = json.object_value().find("childPolicy");
1828
+ if (it != json.object_value().end()) {
1829
+ grpc_error* parse_error = GRPC_ERROR_NONE;
1830
+ child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
1831
+ it->second, &parse_error);
1832
+ if (child_policy == nullptr) {
1833
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
1834
+ std::vector<grpc_error*> child_errors;
1835
+ child_errors.push_back(parse_error);
1836
+ error_list.push_back(
1837
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
1838
+ }
1839
+ }
1840
+ // Fallback policy.
1832
1841
  RefCountedPtr<LoadBalancingPolicy::Config> fallback_policy;
1842
+ it = json.object_value().find("fallbackPolicy");
1843
+ if (it != json.object_value().end()) {
1844
+ grpc_error* parse_error = GRPC_ERROR_NONE;
1845
+ fallback_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
1846
+ it->second, &parse_error);
1847
+ if (fallback_policy == nullptr) {
1848
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
1849
+ std::vector<grpc_error*> child_errors;
1850
+ child_errors.push_back(parse_error);
1851
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
1852
+ "field:fallbackPolicy", &child_errors));
1853
+ }
1854
+ }
1855
+ // EDS service name.
1833
1856
  const char* eds_service_name = nullptr;
1857
+ it = json.object_value().find("edsServiceName");
1858
+ if (it != json.object_value().end()) {
1859
+ if (it->second.type() != Json::Type::STRING) {
1860
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1861
+ "field:edsServiceName error:type should be string"));
1862
+ } else {
1863
+ eds_service_name = it->second.string_value().c_str();
1864
+ }
1865
+ }
1866
+ // LRS load reporting server name.
1834
1867
  const char* lrs_load_reporting_server_name = nullptr;
1835
- for (const grpc_json* field = json->child; field != nullptr;
1836
- field = field->next) {
1837
- if (field->key == nullptr) continue;
1838
- if (strcmp(field->key, "childPolicy") == 0) {
1839
- if (child_policy != nullptr) {
1840
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1841
- "field:childPolicy error:Duplicate entry"));
1842
- }
1843
- grpc_error* parse_error = GRPC_ERROR_NONE;
1844
- child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
1845
- field, &parse_error);
1846
- if (child_policy == nullptr) {
1847
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
1848
- error_list.push_back(parse_error);
1849
- }
1850
- } else if (strcmp(field->key, "fallbackPolicy") == 0) {
1851
- if (fallback_policy != nullptr) {
1852
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1853
- "field:fallbackPolicy error:Duplicate entry"));
1854
- }
1855
- grpc_error* parse_error = GRPC_ERROR_NONE;
1856
- fallback_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
1857
- field, &parse_error);
1858
- if (fallback_policy == nullptr) {
1859
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
1860
- error_list.push_back(parse_error);
1861
- }
1862
- } else if (strcmp(field->key, "edsServiceName") == 0) {
1863
- if (eds_service_name != nullptr) {
1864
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1865
- "field:edsServiceName error:Duplicate entry"));
1866
- }
1867
- if (field->type != GRPC_JSON_STRING) {
1868
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1869
- "field:edsServiceName error:type should be string"));
1870
- continue;
1871
- }
1872
- eds_service_name = field->value;
1873
- } else if (strcmp(field->key, "lrsLoadReportingServerName") == 0) {
1874
- if (lrs_load_reporting_server_name != nullptr) {
1875
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1876
- "field:lrsLoadReportingServerName error:Duplicate entry"));
1877
- }
1878
- if (field->type != GRPC_JSON_STRING) {
1879
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1880
- "field:lrsLoadReportingServerName error:type should be string"));
1881
- continue;
1882
- }
1883
- lrs_load_reporting_server_name = field->value;
1868
+ it = json.object_value().find("lrsLoadReportingServerName");
1869
+ if (it != json.object_value().end()) {
1870
+ if (it->second.type() != Json::Type::STRING) {
1871
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1872
+ "field:lrsLoadReportingServerName error:type should be string"));
1873
+ } else {
1874
+ lrs_load_reporting_server_name = it->second.string_value().c_str();
1884
1875
  }
1885
1876
  }
1886
1877
  if (error_list.empty()) {
1887
1878
  Optional<std::string> optional_lrs_load_reporting_server_name;
1888
1879
  if (lrs_load_reporting_server_name != nullptr) {
1889
- optional_lrs_load_reporting_server_name.set(
1880
+ optional_lrs_load_reporting_server_name.emplace(
1890
1881
  std::string(lrs_load_reporting_server_name));
1891
1882
  }
1892
- return MakeRefCounted<ParsedXdsConfig>(
1883
+ return MakeRefCounted<XdsConfig>(
1893
1884
  std::move(child_policy), std::move(fallback_policy),
1894
1885
  eds_service_name == nullptr ? "" : eds_service_name,
1895
1886
  std::move(optional_lrs_load_reporting_server_name));
@@ -1911,7 +1902,7 @@ class XdsFactory : public LoadBalancingPolicyFactory {
1911
1902
  void grpc_lb_policy_xds_init() {
1912
1903
  grpc_core::LoadBalancingPolicyRegistry::Builder::
1913
1904
  RegisterLoadBalancingPolicyFactory(
1914
- grpc_core::MakeUnique<grpc_core::XdsFactory>());
1905
+ absl::make_unique<grpc_core::XdsFactory>());
1915
1906
  }
1916
1907
 
1917
1908
  void grpc_lb_policy_xds_shutdown() {}