grpc 1.58.0.pre1 → 1.59.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +48 -33
- data/include/grpc/event_engine/event_engine.h +6 -10
- data/include/grpc/impl/channel_arg_names.h +4 -0
- data/include/grpc/support/port_platform.h +74 -1
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +22 -9
- data/src/core/ext/filters/client_channel/client_channel.cc +422 -56
- data/src/core/ext/filters/client_channel/client_channel.h +52 -8
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +15 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.h +2 -0
- data/src/core/ext/filters/client_channel/{http_proxy.cc → http_proxy_mapper.cc} +1 -1
- data/src/core/ext/filters/client_channel/{http_proxy.h → http_proxy_mapper.h} +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.cc +188 -0
- data/src/core/ext/filters/client_channel/lb_policy/endpoint_list.h +214 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +17 -4
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +41 -6
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +32 -103
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +416 -139
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +16 -0
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +434 -459
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +410 -26
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +14 -46
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +851 -57
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +16 -10
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +47 -32
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +55 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +105 -175
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +14 -7
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +24 -6
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +36 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +54 -44
- data/src/core/ext/filters/client_channel/subchannel.cc +33 -0
- data/src/core/ext/filters/client_channel/subchannel.h +9 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +11 -6
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +28 -22
- data/src/core/ext/transport/chttp2/transport/flow_control.h +27 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +19 -10
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +66 -47
- data/src/core/ext/transport/chttp2/transport/{frame.h → legacy_frame.h} +3 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +4 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/writing.cc +2 -1
- data/src/core/ext/transport/inproc/inproc_transport.cc +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +75 -83
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +16 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +73 -81
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +294 -302
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +42 -44
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +141 -149
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +36 -38
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +157 -165
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +87 -89
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +13 -15
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +55 -63
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +111 -113
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +441 -449
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +88 -96
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +40 -42
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +180 -188
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +26 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +65 -67
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +245 -253
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +119 -127
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +184 -192
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +49 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +225 -233
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +63 -65
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +246 -254
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +28 -36
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +48 -56
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +92 -100
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +27 -29
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +108 -116
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +38 -40
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +167 -175
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +34 -36
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +162 -170
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +10 -12
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +37 -45
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +22 -24
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +97 -105
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +24 -26
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +111 -119
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +43 -45
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +183 -191
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +20 -22
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +102 -110
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +253 -255
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +1108 -1116
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +150 -158
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +53 -61
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +8 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +23 -31
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +372 -380
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +30 -38
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +21 -23
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +81 -89
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +12 -14
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +52 -60
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +14 -22
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +114 -116
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +468 -476
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +25 -33
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +11 -13
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +40 -48
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +27 -35
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +5 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +35 -37
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +165 -173
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +9 -11
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +32 -40
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +39 -41
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +169 -177
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +55 -57
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +241 -249
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +23 -25
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +98 -106
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +11 -19
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +9 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +16 -24
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +24 -32
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +6 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +18 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +31 -39
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +8 -10
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +34 -42
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +14 -16
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +47 -55
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +13 -21
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -4
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +4 -12
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +6 -8
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +20 -28
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +1 -3
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +1 -9
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +10 -18
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +4 -6
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +12 -20
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +2 -4
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +1 -9
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +45 -47
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +190 -198
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +54 -56
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +210 -218
- data/src/core/ext/upb-generated/google/api/http.upb.c +15 -17
- data/src/core/ext/upb-generated/google/api/http.upb.h +60 -68
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -6
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +15 -23
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +359 -204
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1340 -760
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -3
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +1 -9
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +11 -13
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +43 -51
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -5
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +7 -15
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +10 -12
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +28 -36
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -6
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +15 -23
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +11 -13
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +35 -43
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +10 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +28 -36
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +48 -50
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +190 -198
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +5 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +15 -23
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +3 -5
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +7 -15
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +21 -23
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +80 -88
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +9 -11
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +29 -37
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +32 -34
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +147 -155
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +4 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +7 -15
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/validate/validate.upb.c +201 -203
- data/src/core/ext/upb-generated/validate/validate.upb.h +924 -932
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +7 -15
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +16 -24
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +4 -12
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +6 -8
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +20 -28
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +8 -16
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +12 -20
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +9 -11
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +35 -43
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +14 -22
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +16 -18
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +43 -51
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +13 -21
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +2 -4
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +5 -13
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +4 -6
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +21 -29
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +1 -3
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +1 -9
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +24 -32
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +24 -26
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +103 -111
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +10 -12
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +61 -69
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +9 -17
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +8 -10
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +33 -41
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +5 -7
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +18 -26
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +7 -9
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +19 -27
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -5
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +8 -16
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +367 -290
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +10 -0
- data/src/core/ext/xds/xds_client.cc +6 -9
- data/src/core/ext/xds/xds_client.h +2 -2
- data/src/core/ext/xds/xds_cluster.cc +30 -42
- data/src/core/ext/xds/xds_cluster.h +0 -4
- data/src/core/ext/xds/xds_endpoint.cc +12 -19
- data/src/core/ext/xds/xds_endpoint.h +0 -1
- data/src/core/ext/xds/xds_http_filters.cc +1 -4
- data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -4
- data/src/core/ext/xds/xds_listener.cc +14 -14
- data/src/core/ext/xds/xds_listener.h +13 -3
- data/src/core/ext/xds/xds_resource_type.h +1 -7
- data/src/core/ext/xds/xds_resource_type_impl.h +9 -11
- data/src/core/ext/xds/xds_route_config.cc +10 -11
- data/src/core/ext/xds/xds_route_config.h +1 -1
- data/src/core/ext/xds/xds_server_config_fetcher.cc +53 -28
- data/src/core/ext/xds/xds_transport_grpc.cc +11 -1
- data/src/core/lib/backoff/random_early_detection.cc +4 -2
- data/src/core/lib/backoff/random_early_detection.h +2 -4
- data/src/core/lib/channel/call_tracer.cc +7 -1
- data/src/core/lib/channel/call_tracer.h +4 -1
- data/src/core/lib/channel/channelz_registry.h +4 -2
- data/src/core/lib/channel/connected_channel.cc +1 -1
- data/src/core/lib/config/config_vars.h +1 -1
- data/src/core/lib/config/core_configuration.cc +2 -1
- data/src/core/lib/config/core_configuration.h +5 -4
- data/src/core/lib/debug/stats_data.cc +146 -51
- data/src/core/lib/debug/stats_data.h +81 -20
- data/src/core/lib/event_engine/ares_resolver.cc +9 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +3 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +3 -0
- data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +3 -0
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +15 -3
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +3 -0
- data/src/core/lib/event_engine/nameser.h +102 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.h +15 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +3 -15
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +10 -4
- data/src/core/lib/experiments/config.cc +9 -1
- data/src/core/lib/experiments/experiments.cc +409 -144
- data/src/core/lib/experiments/experiments.h +153 -39
- data/src/core/lib/gprpp/fork.h +1 -1
- data/src/core/lib/gprpp/manual_constructor.h +1 -2
- data/src/core/lib/gprpp/no_destruct.h +1 -1
- data/src/core/lib/gprpp/per_cpu.cc +2 -0
- data/src/core/lib/gprpp/per_cpu.h +36 -7
- data/src/core/lib/gprpp/ref_counted_ptr.h +63 -0
- data/src/core/lib/gprpp/work_serializer.cc +297 -25
- data/src/core/lib/gprpp/work_serializer.h +25 -9
- data/src/core/lib/iomgr/combiner.cc +54 -15
- data/src/core/lib/iomgr/combiner.h +8 -3
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -4
- data/src/core/lib/iomgr/exec_ctx.cc +12 -0
- data/src/core/lib/iomgr/exec_ctx.h +55 -19
- data/src/core/lib/iomgr/polling_entity.cc +10 -0
- data/src/core/lib/iomgr/polling_entity.h +2 -0
- data/src/core/lib/iomgr/port.h +14 -0
- data/src/core/lib/iomgr/tcp_posix.cc +17 -14
- data/src/core/lib/load_balancing/lb_policy.h +10 -9
- data/src/core/lib/promise/arena_promise.h +5 -1
- data/src/core/lib/promise/detail/seq_state.h +418 -0
- data/src/core/lib/promise/latch.h +1 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/pipe.h +24 -24
- data/src/core/lib/promise/poll.h +4 -6
- data/src/core/lib/resolver/server_address.h +1 -0
- data/src/core/lib/resource_quota/memory_quota.cc +58 -2
- data/src/core/lib/resource_quota/memory_quota.h +4 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +115 -9
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +14 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc +86 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +0 -59
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +2 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +7 -57
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +2 -14
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/slice/slice_buffer.cc +15 -0
- data/src/core/lib/slice/slice_buffer.h +16 -4
- data/src/core/lib/slice/slice_refcount.h +1 -1
- data/src/core/lib/surface/call.cc +92 -34
- data/src/core/lib/surface/call.h +4 -0
- data/src/core/lib/surface/channel.cc +7 -4
- data/src/core/lib/surface/channel_init.h +3 -2
- data/src/core/lib/surface/server.cc +45 -5
- data/src/core/lib/surface/server.h +18 -6
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/batch_builder.cc +3 -5
- data/src/core/lib/transport/metadata_batch.cc +6 -0
- data/src/core/lib/transport/metadata_batch.h +20 -1
- data/src/core/lib/transport/parsed_metadata.h +2 -4
- data/src/core/lib/transport/simple_slice_based_metadata.h +1 -2
- data/src/core/lib/transport/transport.h +21 -11
- data/src/core/tsi/ssl_transport_security.cc +7 -0
- data/src/core/tsi/ssl_transport_security.h +4 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_channel_args.c +6 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +4 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +185 -0
- data/third_party/upb/upb/collections/array.c +6 -0
- data/third_party/upb/upb/collections/array.h +6 -0
- data/third_party/upb/upb/collections/map.c +7 -0
- data/third_party/upb/upb/collections/map.h +5 -0
- data/third_party/upb/upb/collections/map_sorter_internal.h +1 -1
- data/third_party/upb/upb/collections/message_value.h +8 -1
- data/third_party/upb/upb/generated_code_support.h +54 -0
- data/third_party/upb/upb/hash/common.c +5 -0
- data/third_party/upb/upb/hash/common.h +1 -0
- data/third_party/upb/upb/hash/str_table.h +1 -0
- data/third_party/upb/upb/message/accessors.c +25 -1
- data/third_party/upb/upb/message/accessors.h +46 -25
- data/third_party/upb/upb/message/accessors_internal.h +69 -3
- data/third_party/upb/upb/message/extension_internal.h +1 -1
- data/third_party/upb/upb/message/internal/map_entry.h +64 -0
- data/third_party/upb/upb/message/internal.h +2 -6
- data/third_party/upb/upb/message/message.c +0 -6
- data/third_party/upb/upb/message/message.h +1 -1
- data/third_party/upb/upb/message/tagged_ptr.h +89 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +150 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.h +63 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.c +122 -374
- data/third_party/upb/upb/{mini_table → mini_descriptor}/decode.h +11 -50
- data/third_party/upb/upb/mini_descriptor/internal/base92.c +46 -0
- data/third_party/upb/upb/mini_descriptor/internal/base92.h +81 -0
- data/third_party/upb/upb/mini_descriptor/internal/decoder.h +73 -0
- data/third_party/upb/upb/{mini_table → mini_descriptor/internal}/encode.c +58 -32
- data/third_party/upb/upb/{mini_table/encode_internal.h → mini_descriptor/internal/encode.h} +3 -4
- data/third_party/upb/upb/{mini_table/encode_internal.hpp → mini_descriptor/internal/encode.hpp} +1 -1
- data/third_party/upb/upb/mini_descriptor/internal/modifiers.h +50 -0
- data/third_party/upb/upb/{mini_table/common_internal.h → mini_descriptor/internal/wire_constants.h} +3 -23
- data/third_party/upb/upb/mini_descriptor/link.c +142 -0
- data/third_party/upb/upb/mini_descriptor/link.h +104 -0
- data/third_party/upb/upb/mini_table/{types.h → enum.h} +19 -9
- data/third_party/upb/upb/mini_table/extension.h +40 -0
- data/third_party/upb/upb/mini_table/extension_registry.c +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.h +2 -1
- data/third_party/upb/upb/mini_table/field.h +118 -0
- data/third_party/upb/upb/{json_decode.h → mini_table/file.h} +5 -6
- data/third_party/upb/upb/mini_table/{enum_internal.h → internal/enum.h} +7 -19
- data/third_party/upb/upb/mini_table/{extension_internal.h → internal/extension.h} +8 -8
- data/third_party/upb/upb/mini_table/{field_internal.h → internal/field.h} +10 -66
- data/third_party/upb/upb/mini_table/{file_internal.h → internal/file.h} +6 -4
- data/third_party/upb/upb/mini_table/internal/message.c +39 -0
- data/third_party/upb/upb/mini_table/{message_internal.h → internal/message.h} +14 -37
- data/third_party/upb/upb/mini_table/{sub_internal.h → internal/sub.h} +7 -6
- data/third_party/upb/upb/mini_table/{common.c → message.c} +2 -33
- data/third_party/upb/upb/mini_table/{common.h → message.h} +12 -77
- data/third_party/upb/upb/{json_encode.h → mini_table/sub.h} +5 -6
- data/third_party/upb/upb/reflection/def.hpp +16 -4
- data/third_party/upb/upb/reflection/def_pool_internal.h +1 -1
- data/third_party/upb/upb/reflection/desc_state_internal.h +1 -1
- data/third_party/upb/upb/reflection/enum_def.c +1 -1
- data/third_party/upb/upb/reflection/field_def.c +2 -1
- data/third_party/upb/upb/reflection/message.c +2 -2
- data/third_party/upb/upb/reflection/message_def.c +3 -1
- data/third_party/upb/upb/wire/decode.c +68 -29
- data/third_party/upb/upb/wire/decode.h +40 -0
- data/third_party/upb/upb/wire/encode.c +23 -13
- metadata +46 -29
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.cc +0 -256
- data/src/core/lib/event_engine/thread_pool/original_thread_pool.h +0 -137
@@ -0,0 +1,185 @@
|
|
1
|
+
//
|
2
|
+
// Copyright 2018 The Abseil Authors.
|
3
|
+
//
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
// you may not use this file except in compliance with the License.
|
6
|
+
// You may obtain a copy of the License at
|
7
|
+
//
|
8
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
//
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
// See the License for the specific language governing permissions and
|
14
|
+
// limitations under the License.
|
15
|
+
//
|
16
|
+
// -----------------------------------------------------------------------------
|
17
|
+
// File: bit_gen_ref.h
|
18
|
+
// -----------------------------------------------------------------------------
|
19
|
+
//
|
20
|
+
// This header defines a bit generator "reference" class, for use in interfaces
|
21
|
+
// that take both Abseil (e.g. `absl::BitGen`) and standard library (e.g.
|
22
|
+
// `std::mt19937`) bit generators.
|
23
|
+
|
24
|
+
#ifndef ABSL_RANDOM_BIT_GEN_REF_H_
|
25
|
+
#define ABSL_RANDOM_BIT_GEN_REF_H_
|
26
|
+
|
27
|
+
#include <limits>
|
28
|
+
#include <type_traits>
|
29
|
+
#include <utility>
|
30
|
+
|
31
|
+
#include "absl/base/internal/fast_type_id.h"
|
32
|
+
#include "absl/base/macros.h"
|
33
|
+
#include "absl/meta/type_traits.h"
|
34
|
+
#include "absl/random/internal/distribution_caller.h"
|
35
|
+
#include "absl/random/internal/fast_uniform_bits.h"
|
36
|
+
|
37
|
+
namespace absl {
|
38
|
+
ABSL_NAMESPACE_BEGIN
|
39
|
+
namespace random_internal {
|
40
|
+
|
41
|
+
template <typename URBG, typename = void, typename = void, typename = void>
|
42
|
+
struct is_urbg : std::false_type {};
|
43
|
+
|
44
|
+
template <typename URBG>
|
45
|
+
struct is_urbg<
|
46
|
+
URBG,
|
47
|
+
absl::enable_if_t<std::is_same<
|
48
|
+
typename URBG::result_type,
|
49
|
+
typename std::decay<decltype((URBG::min)())>::type>::value>,
|
50
|
+
absl::enable_if_t<std::is_same<
|
51
|
+
typename URBG::result_type,
|
52
|
+
typename std::decay<decltype((URBG::max)())>::type>::value>,
|
53
|
+
absl::enable_if_t<std::is_same<
|
54
|
+
typename URBG::result_type,
|
55
|
+
typename std::decay<decltype(std::declval<URBG>()())>::type>::value>>
|
56
|
+
: std::true_type {};
|
57
|
+
|
58
|
+
template <typename>
|
59
|
+
struct DistributionCaller;
|
60
|
+
class MockHelpers;
|
61
|
+
|
62
|
+
} // namespace random_internal
|
63
|
+
|
64
|
+
// -----------------------------------------------------------------------------
|
65
|
+
// absl::BitGenRef
|
66
|
+
// -----------------------------------------------------------------------------
|
67
|
+
//
|
68
|
+
// `absl::BitGenRef` is a type-erasing class that provides a generator-agnostic
|
69
|
+
// non-owning "reference" interface for use in place of any specific uniform
|
70
|
+
// random bit generator (URBG). This class may be used for both Abseil
|
71
|
+
// (e.g. `absl::BitGen`, `absl::InsecureBitGen`) and Standard library (e.g
|
72
|
+
// `std::mt19937`, `std::minstd_rand`) bit generators.
|
73
|
+
//
|
74
|
+
// Like other reference classes, `absl::BitGenRef` does not own the
|
75
|
+
// underlying bit generator, and the underlying instance must outlive the
|
76
|
+
// `absl::BitGenRef`.
|
77
|
+
//
|
78
|
+
// `absl::BitGenRef` is particularly useful when used with an
|
79
|
+
// `absl::MockingBitGen` to test specific paths in functions which use random
|
80
|
+
// values.
|
81
|
+
//
|
82
|
+
// Example:
|
83
|
+
// void TakesBitGenRef(absl::BitGenRef gen) {
|
84
|
+
// int x = absl::Uniform<int>(gen, 0, 1000);
|
85
|
+
// }
|
86
|
+
//
|
87
|
+
class BitGenRef {
|
88
|
+
// SFINAE to detect whether the URBG type includes a member matching
|
89
|
+
// bool InvokeMock(base_internal::FastTypeIdType, void*, void*).
|
90
|
+
//
|
91
|
+
// These live inside BitGenRef so that they have friend access
|
92
|
+
// to MockingBitGen. (see similar methods in DistributionCaller).
|
93
|
+
template <template <class...> class Trait, class AlwaysVoid, class... Args>
|
94
|
+
struct detector : std::false_type {};
|
95
|
+
template <template <class...> class Trait, class... Args>
|
96
|
+
struct detector<Trait, absl::void_t<Trait<Args...>>, Args...>
|
97
|
+
: std::true_type {};
|
98
|
+
|
99
|
+
template <class T>
|
100
|
+
using invoke_mock_t = decltype(std::declval<T*>()->InvokeMock(
|
101
|
+
std::declval<base_internal::FastTypeIdType>(), std::declval<void*>(),
|
102
|
+
std::declval<void*>()));
|
103
|
+
|
104
|
+
template <typename T>
|
105
|
+
using HasInvokeMock = typename detector<invoke_mock_t, void, T>::type;
|
106
|
+
|
107
|
+
public:
|
108
|
+
BitGenRef(const BitGenRef&) = default;
|
109
|
+
BitGenRef(BitGenRef&&) = default;
|
110
|
+
BitGenRef& operator=(const BitGenRef&) = default;
|
111
|
+
BitGenRef& operator=(BitGenRef&&) = default;
|
112
|
+
|
113
|
+
template <typename URBG, typename absl::enable_if_t<
|
114
|
+
(!std::is_same<URBG, BitGenRef>::value &&
|
115
|
+
random_internal::is_urbg<URBG>::value &&
|
116
|
+
!HasInvokeMock<URBG>::value)>* = nullptr>
|
117
|
+
BitGenRef(URBG& gen) // NOLINT
|
118
|
+
: t_erased_gen_ptr_(reinterpret_cast<uintptr_t>(&gen)),
|
119
|
+
mock_call_(NotAMock),
|
120
|
+
generate_impl_fn_(ImplFn<URBG>) {}
|
121
|
+
|
122
|
+
template <typename URBG,
|
123
|
+
typename absl::enable_if_t<(!std::is_same<URBG, BitGenRef>::value &&
|
124
|
+
random_internal::is_urbg<URBG>::value &&
|
125
|
+
HasInvokeMock<URBG>::value)>* = nullptr>
|
126
|
+
BitGenRef(URBG& gen) // NOLINT
|
127
|
+
: t_erased_gen_ptr_(reinterpret_cast<uintptr_t>(&gen)),
|
128
|
+
mock_call_(&MockCall<URBG>),
|
129
|
+
generate_impl_fn_(ImplFn<URBG>) {}
|
130
|
+
|
131
|
+
using result_type = uint64_t;
|
132
|
+
|
133
|
+
static constexpr result_type(min)() {
|
134
|
+
return (std::numeric_limits<result_type>::min)();
|
135
|
+
}
|
136
|
+
|
137
|
+
static constexpr result_type(max)() {
|
138
|
+
return (std::numeric_limits<result_type>::max)();
|
139
|
+
}
|
140
|
+
|
141
|
+
result_type operator()() { return generate_impl_fn_(t_erased_gen_ptr_); }
|
142
|
+
|
143
|
+
private:
|
144
|
+
using impl_fn = result_type (*)(uintptr_t);
|
145
|
+
using mock_call_fn = bool (*)(uintptr_t, base_internal::FastTypeIdType, void*,
|
146
|
+
void*);
|
147
|
+
|
148
|
+
template <typename URBG>
|
149
|
+
static result_type ImplFn(uintptr_t ptr) {
|
150
|
+
// Ensure that the return values from operator() fill the entire
|
151
|
+
// range promised by result_type, min() and max().
|
152
|
+
absl::random_internal::FastUniformBits<result_type> fast_uniform_bits;
|
153
|
+
return fast_uniform_bits(*reinterpret_cast<URBG*>(ptr));
|
154
|
+
}
|
155
|
+
|
156
|
+
// Get a type-erased InvokeMock pointer.
|
157
|
+
template <typename URBG>
|
158
|
+
static bool MockCall(uintptr_t gen_ptr, base_internal::FastTypeIdType type,
|
159
|
+
void* result, void* arg_tuple) {
|
160
|
+
return reinterpret_cast<URBG*>(gen_ptr)->InvokeMock(type, result,
|
161
|
+
arg_tuple);
|
162
|
+
}
|
163
|
+
static bool NotAMock(uintptr_t, base_internal::FastTypeIdType, void*, void*) {
|
164
|
+
return false;
|
165
|
+
}
|
166
|
+
|
167
|
+
inline bool InvokeMock(base_internal::FastTypeIdType type, void* args_tuple,
|
168
|
+
void* result) {
|
169
|
+
if (mock_call_ == NotAMock) return false; // avoids an indirect call.
|
170
|
+
return mock_call_(t_erased_gen_ptr_, type, args_tuple, result);
|
171
|
+
}
|
172
|
+
|
173
|
+
uintptr_t t_erased_gen_ptr_;
|
174
|
+
mock_call_fn mock_call_;
|
175
|
+
impl_fn generate_impl_fn_;
|
176
|
+
|
177
|
+
template <typename>
|
178
|
+
friend struct ::absl::random_internal::DistributionCaller; // for InvokeMock
|
179
|
+
friend class ::absl::random_internal::MockHelpers; // for InvokeMock
|
180
|
+
};
|
181
|
+
|
182
|
+
ABSL_NAMESPACE_END
|
183
|
+
} // namespace absl
|
184
|
+
|
185
|
+
#endif // ABSL_RANDOM_BIT_GEN_REF_H_
|
@@ -50,6 +50,12 @@ upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
|
|
50
50
|
return _upb_Array_New(a, 4, _upb_Array_CTypeSizeLg2(type));
|
51
51
|
}
|
52
52
|
|
53
|
+
const void* upb_Array_DataPtr(const upb_Array* arr) {
|
54
|
+
return _upb_array_ptr((upb_Array*)arr);
|
55
|
+
}
|
56
|
+
|
57
|
+
void* upb_Array_MutableDataPtr(upb_Array* arr) { return _upb_array_ptr(arr); }
|
58
|
+
|
53
59
|
size_t upb_Array_Size(const upb_Array* arr) { return arr->size; }
|
54
60
|
|
55
61
|
upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
|
@@ -76,6 +76,12 @@ UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
|
|
76
76
|
// Returns false on allocation failure.
|
77
77
|
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
|
78
78
|
|
79
|
+
// Returns pointer to array data.
|
80
|
+
UPB_API const void* upb_Array_DataPtr(const upb_Array* arr);
|
81
|
+
|
82
|
+
// Returns mutable pointer to array data.
|
83
|
+
UPB_API void* upb_Array_MutableDataPtr(upb_Array* arr);
|
84
|
+
|
79
85
|
#ifdef __cplusplus
|
80
86
|
} /* extern "C" */
|
81
87
|
#endif
|
@@ -90,6 +90,13 @@ bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key,
|
|
90
90
|
return ok;
|
91
91
|
}
|
92
92
|
|
93
|
+
UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter,
|
94
|
+
upb_MessageValue val) {
|
95
|
+
upb_value v;
|
96
|
+
_upb_map_tovalue(&val, map->val_size, &v, NULL);
|
97
|
+
upb_strtable_setentryvalue(&map->table, iter, v);
|
98
|
+
}
|
99
|
+
|
93
100
|
bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) {
|
94
101
|
return _upb_map_next(map, iter);
|
95
102
|
}
|
@@ -103,6 +103,11 @@ UPB_INLINE bool upb_Map_Delete2(upb_Map* map, upb_MessageValue key,
|
|
103
103
|
UPB_API bool upb_Map_Next(const upb_Map* map, upb_MessageValue* key,
|
104
104
|
upb_MessageValue* val, size_t* iter);
|
105
105
|
|
106
|
+
// Sets the value for the entry pointed to by iter.
|
107
|
+
// WARNING: this does not currently work for string values!
|
108
|
+
UPB_API void upb_Map_SetEntryValue(upb_Map* map, size_t iter,
|
109
|
+
upb_MessageValue val);
|
110
|
+
|
106
111
|
// DEPRECATED iterator, slated for removal.
|
107
112
|
|
108
113
|
/* Map iteration:
|
@@ -32,7 +32,8 @@
|
|
32
32
|
#define UPB_MESSAGE_VALUE_H_
|
33
33
|
|
34
34
|
#include "upb/base/string_view.h"
|
35
|
-
#include "upb/
|
35
|
+
#include "upb/message/tagged_ptr.h"
|
36
|
+
#include "upb/mini_table/message.h"
|
36
37
|
|
37
38
|
// Must be last.
|
38
39
|
#include "upb/port/def.inc"
|
@@ -52,6 +53,12 @@ typedef union {
|
|
52
53
|
const upb_Map* map_val;
|
53
54
|
const upb_Message* msg_val;
|
54
55
|
upb_StringView str_val;
|
56
|
+
|
57
|
+
// EXPERIMENTAL: A tagged upb_Message*. Users must use this instead of
|
58
|
+
// msg_val if unlinked sub-messages may possibly be in use. See the
|
59
|
+
// documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
|
60
|
+
// information.
|
61
|
+
upb_TaggedMessagePtr tagged_msg_val;
|
55
62
|
} upb_MessageValue;
|
56
63
|
|
57
64
|
typedef union {
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2009-2023, Google LLC
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
7
|
+
* * Redistributions of source code must retain the above copyright
|
8
|
+
* notice, this list of conditions and the following disclaimer.
|
9
|
+
* * Redistributions in binary form must reproduce the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer in the
|
11
|
+
* documentation and/or other materials provided with the distribution.
|
12
|
+
* * Neither the name of Google LLC nor the
|
13
|
+
* names of its contributors may be used to endorse or promote products
|
14
|
+
* derived from this software without specific prior written permission.
|
15
|
+
*
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
19
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
|
20
|
+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
21
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
22
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
23
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
24
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
|
28
|
+
#ifndef UPB_GENERATED_CODE_SUPPORT_H_
|
29
|
+
#define UPB_GENERATED_CODE_SUPPORT_H_
|
30
|
+
|
31
|
+
// IWYU pragma: begin_exports
|
32
|
+
#include "upb/collections/array.h"
|
33
|
+
#include "upb/collections/array_internal.h"
|
34
|
+
#include "upb/collections/map_gencode_util.h"
|
35
|
+
#include "upb/collections/message_value.h"
|
36
|
+
#include "upb/extension_registry.h"
|
37
|
+
#include "upb/message/accessors.h"
|
38
|
+
#include "upb/message/accessors_internal.h"
|
39
|
+
#include "upb/message/extension_internal.h"
|
40
|
+
#include "upb/message/internal.h"
|
41
|
+
#include "upb/message/message.h"
|
42
|
+
#include "upb/mini_descriptor/decode.h"
|
43
|
+
#include "upb/mini_table/enum.h"
|
44
|
+
#include "upb/mini_table/extension.h"
|
45
|
+
#include "upb/mini_table/field.h"
|
46
|
+
#include "upb/mini_table/file.h"
|
47
|
+
#include "upb/mini_table/message.h"
|
48
|
+
#include "upb/mini_table/sub.h"
|
49
|
+
#include "upb/wire/decode.h"
|
50
|
+
#include "upb/wire/decode_fast.h"
|
51
|
+
#include "upb/wire/encode.h"
|
52
|
+
// IWYU pragma: end_exports
|
53
|
+
|
54
|
+
#endif // UPB_GENERATED_CODE_SUPPORT_H_
|
@@ -866,3 +866,8 @@ void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter) {
|
|
866
866
|
ent->key = 0;
|
867
867
|
ent->next = NULL;
|
868
868
|
}
|
869
|
+
|
870
|
+
void upb_strtable_setentryvalue(upb_strtable* t, intptr_t iter, upb_value v) {
|
871
|
+
upb_tabent* ent = &t->t.entries[iter];
|
872
|
+
ent->val.val = v.val;
|
873
|
+
}
|
@@ -98,6 +98,7 @@ FUNCS(uint32, uint32, uint32_t, uint32_t, UPB_CTYPE_UINT32)
|
|
98
98
|
FUNCS(uint64, uint64, uint64_t, uint64_t, UPB_CTYPE_UINT64)
|
99
99
|
FUNCS(bool, _bool, bool, bool, UPB_CTYPE_BOOL)
|
100
100
|
FUNCS(cstr, cstr, char*, uintptr_t, UPB_CTYPE_CSTR)
|
101
|
+
FUNCS(uintptr, uptr, uintptr_t, uintptr_t, UPB_CTYPE_UPTR)
|
101
102
|
FUNCS(ptr, ptr, void*, uintptr_t, UPB_CTYPE_PTR)
|
102
103
|
FUNCS(constptr, constptr, const void*, uintptr_t, UPB_CTYPE_CONSTPTR)
|
103
104
|
|
@@ -100,6 +100,7 @@ bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
|
|
100
100
|
bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
|
101
101
|
upb_value* val, intptr_t* iter);
|
102
102
|
void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
|
103
|
+
void upb_strtable_setentryvalue(upb_strtable* t, intptr_t iter, upb_value v);
|
103
104
|
|
104
105
|
/* DEPRECATED iterators, slated for removal.
|
105
106
|
*
|
@@ -31,7 +31,7 @@
|
|
31
31
|
#include "upb/collections/array_internal.h"
|
32
32
|
#include "upb/collections/map.h"
|
33
33
|
#include "upb/message/message.h"
|
34
|
-
#include "upb/mini_table/
|
34
|
+
#include "upb/mini_table/field.h"
|
35
35
|
#include "upb/wire/common.h"
|
36
36
|
#include "upb/wire/decode.h"
|
37
37
|
#include "upb/wire/encode.h"
|
@@ -66,3 +66,27 @@ upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map,
|
|
66
66
|
&map_entry_value);
|
67
67
|
return upb_Map_Insert(map, map_entry_key, map_entry_value, arena);
|
68
68
|
}
|
69
|
+
|
70
|
+
bool upb_Message_IsExactlyEqual(const upb_Message* m1, const upb_Message* m2,
|
71
|
+
const upb_MiniTable* layout) {
|
72
|
+
if (m1 == m2) return true;
|
73
|
+
|
74
|
+
int opts = kUpb_EncodeOption_SkipUnknown | kUpb_EncodeOption_Deterministic;
|
75
|
+
upb_Arena* a = upb_Arena_New();
|
76
|
+
|
77
|
+
// Compare deterministically serialized payloads with no unknown fields.
|
78
|
+
size_t size1, size2;
|
79
|
+
char *data1, *data2;
|
80
|
+
upb_EncodeStatus status1 = upb_Encode(m1, layout, opts, a, &data1, &size1);
|
81
|
+
upb_EncodeStatus status2 = upb_Encode(m2, layout, opts, a, &data2, &size2);
|
82
|
+
|
83
|
+
if (status1 != kUpb_EncodeStatus_Ok || status2 != kUpb_EncodeStatus_Ok) {
|
84
|
+
// TODO(salo): How should we fail here? (In Ruby we throw an exception.)
|
85
|
+
upb_Arena_Free(a);
|
86
|
+
return false;
|
87
|
+
}
|
88
|
+
|
89
|
+
const bool ret = (size1 == size2) && (memcmp(data1, data2, size1) == 0);
|
90
|
+
upb_Arena_Free(a);
|
91
|
+
return ret;
|
92
|
+
}
|
@@ -34,11 +34,9 @@
|
|
34
34
|
#include "upb/collections/map.h"
|
35
35
|
#include "upb/collections/map_internal.h"
|
36
36
|
#include "upb/message/accessors_internal.h"
|
37
|
-
#include "upb/message/extension_internal.h"
|
38
37
|
#include "upb/message/internal.h"
|
39
|
-
#include "upb/mini_table/
|
40
|
-
#include "upb/mini_table/
|
41
|
-
#include "upb/mini_table/field_internal.h"
|
38
|
+
#include "upb/mini_table/enum.h"
|
39
|
+
#include "upb/mini_table/field.h"
|
42
40
|
|
43
41
|
// Must be last.
|
44
42
|
#include "upb/port/def.inc"
|
@@ -57,6 +55,13 @@ UPB_API_INLINE void upb_Message_ClearField(upb_Message* msg,
|
|
57
55
|
}
|
58
56
|
}
|
59
57
|
|
58
|
+
UPB_API_INLINE void upb_Message_Clear(upb_Message* msg,
|
59
|
+
const upb_MiniTable* l) {
|
60
|
+
// Note: Can't use UPB_PTR_AT() here because we are doing pointer subtraction.
|
61
|
+
char* mem = (char*)msg - sizeof(upb_Message_Internal);
|
62
|
+
memset(mem, 0, upb_msg_sizeof(l));
|
63
|
+
}
|
64
|
+
|
60
65
|
UPB_API_INLINE bool upb_Message_HasField(const upb_Message* msg,
|
61
66
|
const upb_MiniTableField* field) {
|
62
67
|
if (upb_MiniTableField_IsExtension(field)) {
|
@@ -248,22 +253,32 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
|
|
248
253
|
return _upb_Message_SetField(msg, field, &value, a);
|
249
254
|
}
|
250
255
|
|
251
|
-
UPB_API_INLINE
|
256
|
+
UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
|
252
257
|
const upb_Message* msg, const upb_MiniTableField* field,
|
253
258
|
upb_Message* default_val) {
|
254
259
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
|
255
260
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
|
256
261
|
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
|
257
262
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
|
258
|
-
|
259
|
-
_upb_Message_GetNonExtensionField(msg, field, &default_val, &
|
260
|
-
return
|
263
|
+
upb_TaggedMessagePtr tagged;
|
264
|
+
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
|
265
|
+
return tagged;
|
261
266
|
}
|
262
267
|
|
263
|
-
UPB_API_INLINE
|
264
|
-
|
265
|
-
|
266
|
-
|
268
|
+
UPB_API_INLINE const upb_Message* upb_Message_GetMessage(
|
269
|
+
const upb_Message* msg, const upb_MiniTableField* field,
|
270
|
+
upb_Message* default_val) {
|
271
|
+
upb_TaggedMessagePtr tagged =
|
272
|
+
upb_Message_GetTaggedMessagePtr(msg, field, default_val);
|
273
|
+
return upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
|
274
|
+
}
|
275
|
+
|
276
|
+
// For internal use only; users cannot set tagged messages because only the
|
277
|
+
// parser and the message copier are allowed to directly create an empty
|
278
|
+
// message.
|
279
|
+
UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
|
280
|
+
upb_Message* msg, const upb_MiniTable* mini_table,
|
281
|
+
const upb_MiniTableField* field, upb_TaggedMessagePtr sub_message) {
|
267
282
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
|
268
283
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
|
269
284
|
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
|
@@ -272,6 +287,14 @@ UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
|
|
272
287
|
_upb_Message_SetNonExtensionField(msg, field, &sub_message);
|
273
288
|
}
|
274
289
|
|
290
|
+
UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
|
291
|
+
const upb_MiniTable* mini_table,
|
292
|
+
const upb_MiniTableField* field,
|
293
|
+
upb_Message* sub_message) {
|
294
|
+
_upb_Message_SetTaggedMessagePtr(
|
295
|
+
msg, mini_table, field, _upb_TaggedMessagePtr_Pack(sub_message, false));
|
296
|
+
}
|
297
|
+
|
275
298
|
UPB_API_INLINE upb_Message* upb_Message_GetOrCreateMutableMessage(
|
276
299
|
upb_Message* msg, const upb_MiniTable* mini_table,
|
277
300
|
const upb_MiniTableField* field, upb_Arena* arena) {
|
@@ -318,36 +341,30 @@ UPB_API_INLINE upb_Array* upb_Message_GetOrCreateMutableArray(
|
|
318
341
|
return array;
|
319
342
|
}
|
320
343
|
|
321
|
-
|
344
|
+
UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
|
322
345
|
upb_Message* msg, const upb_MiniTableField* field, size_t size,
|
323
346
|
upb_Arena* arena) {
|
324
347
|
_upb_MiniTableField_CheckIsArray(field);
|
325
348
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, field, arena);
|
326
349
|
if (!arr || !_upb_Array_ResizeUninitialized(arr, size, arena)) return NULL;
|
327
|
-
return arr;
|
328
|
-
}
|
329
|
-
|
330
|
-
// TODO: remove, migrate users to upb_Message_ResizeArrayUninitialized(), which
|
331
|
-
// has the same semantics but a clearer name. Alternatively, if users want an
|
332
|
-
// initialized variant, we can also offer that.
|
333
|
-
UPB_API_INLINE void* upb_Message_ResizeArray(upb_Message* msg,
|
334
|
-
const upb_MiniTableField* field,
|
335
|
-
size_t size, upb_Arena* arena) {
|
336
|
-
_upb_MiniTableField_CheckIsArray(field);
|
337
|
-
upb_Array* arr =
|
338
|
-
upb_Message_ResizeArrayUninitialized(msg, field, size, arena);
|
339
350
|
return _upb_array_ptr(arr);
|
340
351
|
}
|
341
352
|
|
342
353
|
UPB_API_INLINE const upb_Map* upb_Message_GetMap(
|
343
354
|
const upb_Message* msg, const upb_MiniTableField* field) {
|
344
355
|
_upb_MiniTableField_CheckIsMap(field);
|
356
|
+
_upb_Message_AssertMapIsUntagged(msg, field);
|
345
357
|
upb_Map* ret;
|
346
358
|
const upb_Map* default_val = NULL;
|
347
359
|
_upb_Message_GetNonExtensionField(msg, field, &default_val, &ret);
|
348
360
|
return ret;
|
349
361
|
}
|
350
362
|
|
363
|
+
UPB_API_INLINE upb_Map* upb_Message_GetMutableMap(
|
364
|
+
upb_Message* msg, const upb_MiniTableField* field) {
|
365
|
+
return (upb_Map*)upb_Message_GetMap(msg, field);
|
366
|
+
}
|
367
|
+
|
351
368
|
UPB_API_INLINE upb_Map* upb_Message_GetOrCreateMutableMap(
|
352
369
|
upb_Message* msg, const upb_MiniTable* map_entry_mini_table,
|
353
370
|
const upb_MiniTableField* field, upb_Arena* arena) {
|
@@ -370,6 +387,10 @@ upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map,
|
|
370
387
|
upb_Message* map_entry_message,
|
371
388
|
upb_Arena* arena);
|
372
389
|
|
390
|
+
// Compares two messages by serializing them and calling memcmp().
|
391
|
+
bool upb_Message_IsExactlyEqual(const upb_Message* m1, const upb_Message* m2,
|
392
|
+
const upb_MiniTable* layout);
|
393
|
+
|
373
394
|
#ifdef __cplusplus
|
374
395
|
} /* extern "C" */
|
375
396
|
#endif
|
@@ -28,12 +28,10 @@
|
|
28
28
|
#ifndef UPB_MESSAGE_ACCESSORS_INTERNAL_H_
|
29
29
|
#define UPB_MESSAGE_ACCESSORS_INTERNAL_H_
|
30
30
|
|
31
|
-
#include "upb/collections/array.h"
|
32
31
|
#include "upb/collections/map_internal.h"
|
33
32
|
#include "upb/message/extension_internal.h"
|
34
33
|
#include "upb/message/internal.h"
|
35
|
-
#include "upb/mini_table/
|
36
|
-
#include "upb/mini_table/field_internal.h"
|
34
|
+
#include "upb/mini_table/internal/field.h"
|
37
35
|
|
38
36
|
// Must be last.
|
39
37
|
#include "upb/port/def.inc"
|
@@ -60,6 +58,62 @@
|
|
60
58
|
extern "C" {
|
61
59
|
#endif
|
62
60
|
|
61
|
+
// LINT.IfChange(presence_logic)
|
62
|
+
|
63
|
+
// Hasbit access ///////////////////////////////////////////////////////////////
|
64
|
+
|
65
|
+
UPB_INLINE size_t _upb_hasbit_ofs(size_t idx) { return idx / 8; }
|
66
|
+
|
67
|
+
UPB_INLINE char _upb_hasbit_mask(size_t idx) { return 1 << (idx % 8); }
|
68
|
+
|
69
|
+
UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) {
|
70
|
+
return (*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), const char) &
|
71
|
+
_upb_hasbit_mask(idx)) != 0;
|
72
|
+
}
|
73
|
+
|
74
|
+
UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) {
|
75
|
+
(*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), char)) |= _upb_hasbit_mask(idx);
|
76
|
+
}
|
77
|
+
|
78
|
+
UPB_INLINE void _upb_clearhas(const upb_Message* msg, size_t idx) {
|
79
|
+
(*UPB_PTR_AT(msg, _upb_hasbit_ofs(idx), char)) &= ~_upb_hasbit_mask(idx);
|
80
|
+
}
|
81
|
+
|
82
|
+
UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTableField* f) {
|
83
|
+
UPB_ASSERT(f->presence > 0);
|
84
|
+
return f->presence;
|
85
|
+
}
|
86
|
+
|
87
|
+
UPB_INLINE bool _upb_hasbit_field(const upb_Message* msg,
|
88
|
+
const upb_MiniTableField* f) {
|
89
|
+
return _upb_hasbit(msg, _upb_Message_Hasidx(f));
|
90
|
+
}
|
91
|
+
|
92
|
+
UPB_INLINE void _upb_sethas_field(const upb_Message* msg,
|
93
|
+
const upb_MiniTableField* f) {
|
94
|
+
_upb_sethas(msg, _upb_Message_Hasidx(f));
|
95
|
+
}
|
96
|
+
|
97
|
+
// Oneof case access ///////////////////////////////////////////////////////////
|
98
|
+
|
99
|
+
UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTableField* f) {
|
100
|
+
UPB_ASSERT(f->presence < 0);
|
101
|
+
return ~(ptrdiff_t)f->presence;
|
102
|
+
}
|
103
|
+
|
104
|
+
UPB_INLINE uint32_t* _upb_oneofcase_field(upb_Message* msg,
|
105
|
+
const upb_MiniTableField* f) {
|
106
|
+
return UPB_PTR_AT(msg, _upb_oneofcase_ofs(f), uint32_t);
|
107
|
+
}
|
108
|
+
|
109
|
+
UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message* msg,
|
110
|
+
const upb_MiniTableField* f) {
|
111
|
+
return *_upb_oneofcase_field((upb_Message*)msg, f);
|
112
|
+
}
|
113
|
+
|
114
|
+
// LINT.ThenChange(GoogleInternalName2)
|
115
|
+
// LINT.ThenChange(//depot/google3/third_party/upb/js/impl/upb_bits/presence.ts:presence_logic)
|
116
|
+
|
63
117
|
UPB_INLINE bool _upb_MiniTableField_InOneOf(const upb_MiniTableField* field) {
|
64
118
|
return field->presence < 0;
|
65
119
|
}
|
@@ -296,10 +350,22 @@ UPB_INLINE void _upb_Message_ClearNonExtensionField(
|
|
296
350
|
field);
|
297
351
|
}
|
298
352
|
|
353
|
+
UPB_INLINE void _upb_Message_AssertMapIsUntagged(
|
354
|
+
const upb_Message* msg, const upb_MiniTableField* field) {
|
355
|
+
_upb_MiniTableField_CheckIsMap(field);
|
356
|
+
#ifndef NDEBUG
|
357
|
+
upb_TaggedMessagePtr default_val = 0;
|
358
|
+
upb_TaggedMessagePtr tagged;
|
359
|
+
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
|
360
|
+
UPB_ASSERT(!upb_TaggedMessagePtr_IsEmpty(tagged));
|
361
|
+
#endif
|
362
|
+
}
|
363
|
+
|
299
364
|
UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap(
|
300
365
|
upb_Message* msg, const upb_MiniTableField* field, size_t key_size,
|
301
366
|
size_t val_size, upb_Arena* arena) {
|
302
367
|
_upb_MiniTableField_CheckIsMap(field);
|
368
|
+
_upb_Message_AssertMapIsUntagged(msg, field);
|
303
369
|
upb_Map* map = NULL;
|
304
370
|
upb_Map* default_map_value = NULL;
|
305
371
|
_upb_Message_GetNonExtensionField(msg, field, &default_map_value, &map);
|