grpc 1.52.0 → 1.53.0
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.
- checksums.yaml +4 -4
- data/Makefile +50 -5
- data/include/grpc/event_engine/event_engine.h +24 -2
- data/include/grpc/event_engine/slice_buffer.h +13 -1
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/time.h +6 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +148 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +52 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +29 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +3 -3
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +29 -33
- data/src/core/ext/filters/client_channel/client_channel.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_factory.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/config_selector.h +3 -3
- data/src/core/ext/filters/client_channel/connector.h +8 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +1 -78
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +117 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +128 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.h +71 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +972 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +12 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +275 -107
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +10 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +5 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +6 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/retry_filter.cc +10 -13
- data/src/core/ext/filters/client_channel/retry_filter.h +3 -3
- data/src/core/ext/filters/client_channel/retry_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -1
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +3 -3
- data/src/core/ext/filters/deadline/deadline_filter.cc +40 -48
- data/src/core/ext/filters/deadline/deadline_filter.h +6 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +3 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +26 -21
- data/src/core/ext/filters/http/client/http_client_filter.h +3 -3
- data/src/core/ext/filters/http/client_authority_filter.h +3 -3
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +109 -117
- data/src/core/ext/filters/http/message_compress/compression_filter.h +17 -10
- data/src/core/ext/filters/http/server/http_server_filter.cc +25 -24
- data/src/core/ext/filters/http/server/http_server_filter.h +3 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +2 -1
- data/src/core/ext/filters/message_size/message_size_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +4 -3
- data/src/core/ext/filters/rbac/rbac_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +27 -37
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +5 -5
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.h +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +195 -111
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +18 -407
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http_trace.h +3 -3
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +28 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +111 -31
- data/src/core/ext/transport/chttp2/transport/stream_map.h +3 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -8
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +38 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +185 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +44 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +16 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +48 -74
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +30 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +137 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +15 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +83 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +17 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +61 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +37 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +22 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -5
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +50 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +254 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +21 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +23 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +10 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +42 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +188 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +111 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +444 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +31 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +114 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +3 -1
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +54 -53
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +34 -13
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +195 -187
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +232 -224
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +95 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +94 -93
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +81 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +189 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -133
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +140 -133
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +81 -70
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +771 -741
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +16 -14
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +53 -42
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +363 -356
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +149 -145
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +14 -14
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +10 -9
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +1 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/ext/xds/upb_utils.h +3 -3
- data/src/core/ext/xds/xds_api.h +3 -3
- data/src/core/ext/xds/xds_bootstrap.h +3 -3
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +1 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +3 -3
- data/src/core/ext/xds/xds_channel_args.h +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.h +3 -3
- data/src/core/ext/xds/xds_client.cc +8 -3
- data/src/core/ext/xds/xds_client.h +3 -3
- data/src/core/ext/xds/xds_client_grpc.cc +0 -1
- data/src/core/ext/xds/xds_client_grpc.h +3 -3
- data/src/core/ext/xds/xds_client_stats.h +4 -3
- data/src/core/ext/xds/xds_cluster.cc +11 -7
- data/src/core/ext/xds/xds_cluster.h +6 -6
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +3 -3
- data/src/core/ext/xds/xds_common_types.cc +1 -0
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +1 -1
- data/src/core/ext/xds/xds_endpoint.h +3 -3
- data/src/core/ext/xds/xds_health_status.h +30 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +1 -1
- data/src/core/ext/xds/xds_http_filters.h +3 -3
- data/src/core/ext/xds/xds_http_rbac_filter.h +3 -3
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -3
- data/src/core/ext/xds/xds_lb_policy_registry.cc +95 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +3 -3
- data/src/core/ext/xds/xds_listener.cc +1 -0
- data/src/core/ext/xds/xds_listener.h +3 -3
- data/src/core/ext/xds/xds_resource_type.h +3 -3
- data/src/core/ext/xds/xds_resource_type_impl.h +3 -3
- data/src/core/ext/xds/xds_route_config.cc +6 -0
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_routing.h +3 -3
- data/src/core/ext/xds/xds_transport.h +3 -3
- data/src/core/ext/xds/xds_transport_grpc.h +3 -3
- data/src/core/lib/address_utils/parse_address.h +3 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +1 -0
- data/src/core/lib/address_utils/sockaddr_utils.h +3 -3
- data/src/core/lib/avl/avl.h +3 -3
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/call_finalization.h +3 -3
- data/src/core/lib/channel/call_tracer.h +3 -3
- data/src/core/lib/channel/channel_args.cc +1 -0
- data/src/core/lib/channel/channel_args.h +11 -5
- data/src/core/lib/channel/channel_args_preconditioning.h +3 -3
- data/src/core/lib/channel/channel_fwd.h +3 -3
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +4 -4
- data/src/core/lib/channel/channel_stack_builder.h +3 -3
- data/src/core/lib/channel/channel_stack_builder_impl.cc +14 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +3 -3
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.h +3 -3
- data/src/core/lib/channel/channelz_registry.h +3 -3
- data/src/core/lib/channel/connected_channel.cc +883 -354
- data/src/core/lib/channel/connected_channel.h +3 -3
- data/src/core/lib/channel/context.h +7 -3
- data/src/core/lib/channel/promise_based_filter.cc +532 -260
- data/src/core/lib/channel/promise_based_filter.h +124 -44
- data/src/core/lib/channel/status_util.h +3 -3
- data/src/core/lib/compression/compression_internal.h +3 -3
- data/src/core/lib/compression/message_compress.h +3 -3
- data/src/core/lib/config/core_configuration.h +3 -3
- data/src/core/lib/debug/event_log.h +3 -3
- data/src/core/lib/debug/histogram_view.h +3 -3
- data/src/core/lib/debug/stats.h +3 -3
- data/src/core/lib/debug/stats_data.cc +66 -65
- data/src/core/lib/debug/stats_data.h +42 -33
- data/src/core/lib/debug/trace.h +4 -26
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +5 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -3
- data/src/core/lib/event_engine/common_closures.h +3 -3
- data/src/core/lib/event_engine/default_event_engine.cc +9 -4
- data/src/core/lib/event_engine/default_event_engine.h +30 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +3 -3
- data/src/core/lib/event_engine/event_engine.cc +25 -0
- data/src/core/lib/event_engine/executor/executor.h +3 -3
- data/src/core/lib/event_engine/forkable.cc +11 -6
- data/src/core/lib/event_engine/forkable.h +3 -3
- data/src/core/lib/event_engine/handle_containers.h +10 -3
- data/src/core/lib/event_engine/poller.h +3 -3
- data/src/core/lib/event_engine/posix.h +158 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +44 -16
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +14 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +6 -7
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -3
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +3 -3
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +52 -55
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +46 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +82 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +23 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +60 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +65 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -6
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +19 -0
- data/src/core/lib/event_engine/resolved_address_internal.h +34 -0
- data/src/core/lib/event_engine/shim.cc +56 -0
- data/src/core/lib/event_engine/shim.h +33 -0
- data/src/core/lib/event_engine/slice.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +18 -2
- data/src/core/lib/event_engine/tcp_socket_utils.h +8 -3
- data/src/core/lib/event_engine/thread_local.cc +29 -0
- data/src/core/lib/event_engine/thread_local.h +32 -0
- data/src/core/lib/event_engine/thread_pool.cc +41 -65
- data/src/core/lib/event_engine/thread_pool.h +21 -17
- data/src/core/lib/event_engine/time_util.h +3 -3
- data/src/core/lib/event_engine/trace.cc +6 -0
- data/src/core/lib/event_engine/trace.h +16 -3
- data/src/core/lib/event_engine/utils.cc +2 -2
- data/src/core/lib/event_engine/utils.h +12 -4
- data/src/core/lib/event_engine/windows/iocp.cc +24 -40
- data/src/core/lib/event_engine/windows/iocp.h +3 -3
- data/src/core/lib/event_engine/windows/win_socket.cc +56 -33
- data/src/core/lib/event_engine/windows/win_socket.h +34 -25
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +331 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +103 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +243 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +62 -23
- data/src/core/lib/experiments/config.cc +16 -1
- data/src/core/lib/experiments/config.h +13 -3
- data/src/core/lib/experiments/experiments.cc +14 -8
- data/src/core/lib/experiments/experiments.h +80 -21
- data/src/core/lib/gpr/alloc.h +3 -3
- data/src/core/lib/gpr/spinlock.h +3 -3
- data/src/core/lib/gpr/string.h +3 -3
- data/src/core/lib/gpr/sync_abseil.cc +15 -7
- data/src/core/lib/gpr/time_precise.h +3 -3
- data/src/core/lib/gpr/tmpfile.h +3 -3
- data/src/core/lib/gpr/useful.h +3 -3
- data/src/core/lib/gprpp/atomic_utils.h +3 -3
- data/src/core/lib/gprpp/bitset.h +3 -3
- data/src/core/lib/gprpp/chunked_vector.h +3 -3
- data/src/core/lib/gprpp/construct_destruct.h +3 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +3 -3
- data/src/core/lib/gprpp/crash.h +3 -3
- data/src/core/lib/gprpp/debug_location.h +3 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/env.h +3 -3
- data/src/core/lib/gprpp/examine_stack.h +3 -3
- data/src/core/lib/gprpp/fork.cc +21 -4
- data/src/core/lib/gprpp/fork.h +7 -5
- data/src/core/lib/gprpp/global_config.h +3 -3
- data/src/core/lib/gprpp/global_config_custom.h +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +1 -0
- data/src/core/lib/gprpp/global_config_env.h +3 -3
- data/src/core/lib/gprpp/global_config_generic.h +3 -3
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/load_file.h +3 -3
- data/src/core/lib/gprpp/manual_constructor.h +3 -3
- data/src/core/lib/gprpp/match.h +3 -3
- data/src/core/lib/gprpp/memory.h +3 -3
- data/src/core/lib/gprpp/mpscq.h +3 -3
- data/src/core/lib/gprpp/no_destruct.h +3 -3
- data/src/core/lib/gprpp/notification.h +3 -3
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +3 -3
- data/src/core/lib/gprpp/packed_table.h +3 -3
- data/src/core/lib/gprpp/per_cpu.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -3
- data/src/core/lib/gprpp/single_set_ptr.h +3 -3
- data/src/core/lib/gprpp/sorted_pack.h +3 -3
- data/src/core/lib/gprpp/stat.h +3 -3
- data/src/core/lib/gprpp/status_helper.h +3 -3
- data/src/core/lib/gprpp/strerror.cc +2 -0
- data/src/core/lib/gprpp/strerror.h +3 -3
- data/src/core/lib/gprpp/sync.h +3 -3
- data/src/core/lib/gprpp/table.h +3 -3
- data/src/core/lib/gprpp/tchar.h +3 -3
- data/src/core/lib/gprpp/thd.h +3 -3
- data/src/core/lib/gprpp/time.cc +1 -0
- data/src/core/lib/gprpp/time.h +3 -3
- data/src/core/lib/gprpp/time_averaged_stats.h +3 -3
- data/src/core/lib/gprpp/time_util.h +3 -3
- data/src/core/lib/gprpp/unique_type_name.h +3 -3
- data/src/core/lib/gprpp/validation_errors.h +3 -3
- data/src/core/lib/gprpp/work_serializer.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper_registry.h +3 -3
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +3 -3
- data/src/core/lib/http/httpcli.cc +1 -0
- data/src/core/lib/http/httpcli.h +3 -3
- data/src/core/lib/http/httpcli_ssl_credentials.h +3 -3
- data/src/core/lib/http/parser.h +3 -3
- data/src/core/lib/iomgr/block_annotate.h +3 -3
- data/src/core/lib/iomgr/buffer_list.h +3 -3
- data/src/core/lib/iomgr/call_combiner.cc +4 -4
- data/src/core/lib/iomgr/call_combiner.h +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +3 -3
- data/src/core/lib/iomgr/closure.cc +27 -0
- data/src/core/lib/iomgr/closure.h +5 -3
- data/src/core/lib/iomgr/combiner.h +3 -3
- data/src/core/lib/iomgr/dynamic_annotations.h +3 -3
- data/src/core/lib/iomgr/endpoint.h +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +10 -2
- data/src/core/lib/iomgr/error.h +3 -3
- data/src/core/lib/iomgr/error_cfstream.h +3 -3
- data/src/core/lib/iomgr/ev_apple.h +3 -3
- data/src/core/lib/iomgr/ev_epoll1_linux.h +3 -3
- data/src/core/lib/iomgr/ev_poll_posix.h +3 -3
- data/src/core/lib/iomgr/ev_posix.h +3 -3
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +62 -0
- data/src/core/lib/iomgr/event_engine_shims/closure.h +39 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +430 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +43 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +91 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +44 -0
- data/src/core/lib/iomgr/exec_ctx.h +3 -3
- data/src/core/lib/iomgr/executor.h +3 -3
- data/src/core/lib/iomgr/fork_posix.cc +5 -4
- data/src/core/lib/iomgr/gethostname.h +3 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +3 -3
- data/src/core/lib/iomgr/internal_errqueue.h +3 -3
- data/src/core/lib/iomgr/iocp_windows.h +3 -3
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_fwd.h +3 -3
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/load_file.h +3 -3
- data/src/core/lib/iomgr/lockfree_event.h +3 -3
- data/src/core/lib/iomgr/nameser.h +3 -3
- data/src/core/lib/iomgr/polling_entity.h +3 -3
- data/src/core/lib/iomgr/pollset.h +3 -3
- data/src/core/lib/iomgr/pollset_set.h +3 -3
- data/src/core/lib/iomgr/pollset_set_windows.h +3 -3
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/pollset_windows.h +3 -3
- data/src/core/lib/iomgr/port.h +3 -3
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -3
- data/src/core/lib/iomgr/resolve_address_impl.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.h +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.h +3 -3
- data/src/core/lib/iomgr/resolved_address.h +3 -3
- data/src/core/lib/iomgr/sockaddr.h +3 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +3 -3
- data/src/core/lib/iomgr/sockaddr_windows.h +3 -3
- data/src/core/lib/iomgr/socket_factory_posix.h +3 -3
- data/src/core/lib/iomgr/socket_mutator.h +3 -3
- data/src/core/lib/iomgr/socket_utils.h +3 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -3
- data/src/core/lib/iomgr/socket_windows.h +3 -3
- data/src/core/lib/iomgr/systemd_utils.cc +19 -19
- data/src/core/lib/iomgr/systemd_utils.h +24 -24
- data/src/core/lib/iomgr/tcp_client.h +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +12 -0
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_client_windows.cc +13 -1
- data/src/core/lib/iomgr/tcp_posix.cc +49 -65
- data/src/core/lib/iomgr/tcp_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_server.h +3 -3
- data/src/core/lib/iomgr/tcp_server_posix.cc +219 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_windows.h +3 -3
- data/src/core/lib/iomgr/timer.h +3 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -3
- data/src/core/lib/iomgr/timer_heap.h +3 -3
- data/src/core/lib/iomgr/timer_manager.h +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -3
- data/src/core/lib/json/json.h +3 -3
- data/src/core/lib/json/json_args.h +3 -3
- data/src/core/lib/json/json_channel_args.h +3 -3
- data/src/core/lib/json/json_object_loader.h +3 -3
- data/src/core/lib/json/json_reader.cc +1 -0
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/load_balancing/lb_policy.cc +9 -0
- data/src/core/lib/load_balancing/lb_policy.h +9 -5
- data/src/core/lib/load_balancing/lb_policy_factory.h +3 -3
- data/src/core/lib/load_balancing/lb_policy_registry.cc +1 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +3 -3
- data/src/core/lib/load_balancing/subchannel_interface.h +8 -6
- data/src/core/lib/matchers/matchers.cc +1 -0
- data/src/core/lib/matchers/matchers.h +3 -3
- data/src/core/lib/promise/activity.cc +8 -6
- data/src/core/lib/promise/activity.h +52 -66
- data/src/core/lib/promise/arena_promise.h +3 -3
- data/src/core/lib/promise/context.h +3 -3
- data/src/core/lib/promise/detail/basic_join.h +197 -0
- data/src/core/lib/promise/detail/basic_seq.h +10 -16
- data/src/core/lib/promise/detail/promise_factory.h +3 -3
- data/src/core/lib/promise/detail/promise_like.h +3 -3
- data/src/core/lib/promise/detail/status.h +3 -3
- data/src/core/lib/promise/detail/switch.h +3 -3
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -3
- data/src/core/lib/promise/if.h +195 -0
- data/src/core/lib/promise/interceptor_list.h +308 -0
- data/src/core/lib/promise/intra_activity_waiter.h +9 -3
- data/src/core/lib/promise/latch.h +99 -5
- data/src/core/lib/promise/loop.h +4 -4
- data/src/core/lib/promise/map.h +4 -6
- data/src/core/lib/promise/pipe.h +296 -193
- data/src/core/lib/promise/poll.h +113 -14
- data/src/core/lib/promise/promise.h +4 -5
- data/src/core/lib/promise/race.h +6 -9
- data/src/core/lib/promise/seq.h +3 -3
- data/src/core/lib/promise/sleep.h +3 -3
- data/src/core/lib/promise/{pipe.cc → trace.cc} +3 -2
- data/src/core/lib/promise/trace.h +24 -0
- data/src/core/lib/promise/try_join.h +82 -0
- data/src/core/lib/promise/try_seq.h +3 -3
- data/src/core/lib/resolver/resolver.h +3 -3
- data/src/core/lib/resolver/resolver_factory.h +4 -4
- data/src/core/lib/resolver/resolver_registry.cc +15 -0
- data/src/core/lib/resolver/resolver_registry.h +3 -3
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +3 -3
- data/src/core/lib/resource_quota/api.h +3 -3
- data/src/core/lib/resource_quota/arena.cc +36 -9
- data/src/core/lib/resource_quota/arena.h +84 -22
- data/src/core/lib/resource_quota/memory_quota.h +3 -3
- data/src/core/lib/resource_quota/periodic_update.h +3 -3
- data/src/core/lib/resource_quota/resource_quota.h +3 -3
- data/src/core/lib/resource_quota/thread_quota.h +3 -3
- data/src/core/lib/resource_quota/trace.h +3 -3
- data/src/core/lib/security/authorization/authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/authorization_policy_provider.h +3 -3
- data/src/core/lib/security/authorization/evaluate_args.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +3 -3
- data/src/core/lib/security/authorization/matchers.h +3 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +1 -0
- data/src/core/lib/security/authorization/rbac_policy.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +3 -3
- data/src/core/lib/security/context/security_context.h +3 -3
- data/src/core/lib/security/credentials/alts/alts_credentials.h +3 -3
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +3 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +3 -3
- data/src/core/lib/security/credentials/channel_creds_registry.h +3 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -3
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +3 -3
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +3 -3
- data/src/core/lib/security/credentials/jwt/json_token.h +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -3
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.h +3 -3
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +3 -3
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils_config.h +3 -3
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +3 -3
- data/src/core/lib/security/transport/auth_filters.h +27 -5
- data/src/core/lib/security/transport/secure_endpoint.h +3 -3
- data/src/core/lib/security/transport/security_handshaker.cc +9 -0
- data/src/core/lib/security/transport/security_handshaker.h +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +120 -251
- data/src/core/lib/security/transport/tsi_error.h +3 -3
- data/src/core/lib/security/util/json_util.h +3 -3
- data/src/core/lib/service_config/service_config.h +3 -3
- data/src/core/lib/service_config/service_config_call_data.h +3 -3
- data/src/core/lib/service_config/service_config_impl.h +3 -3
- data/src/core/lib/service_config/service_config_parser.h +3 -3
- data/src/core/lib/slice/b64.h +3 -3
- data/src/core/lib/slice/percent_encoding.h +3 -3
- data/src/core/lib/slice/slice.cc +3 -3
- data/src/core/lib/slice/slice.h +14 -21
- data/src/core/lib/slice/slice_buffer.h +10 -4
- data/src/core/lib/slice/slice_internal.h +3 -3
- data/src/core/lib/slice/slice_refcount.cc +20 -0
- data/src/core/lib/slice/slice_refcount.h +26 -6
- data/src/core/lib/slice/slice_string_helpers.h +3 -3
- data/src/core/lib/surface/api_trace.h +3 -3
- data/src/core/lib/surface/builtins.h +3 -3
- data/src/core/lib/surface/call.cc +866 -252
- data/src/core/lib/surface/call.h +31 -3
- data/src/core/lib/surface/call_log_batch.cc +1 -0
- data/src/core/lib/surface/call_test_only.h +3 -3
- data/src/core/lib/surface/call_trace.cc +21 -11
- data/src/core/lib/surface/call_trace.h +3 -3
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/channel_init.h +3 -3
- data/src/core/lib/surface/channel_stack_type.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -0
- data/src/core/lib/surface/completion_queue.h +3 -3
- data/src/core/lib/surface/completion_queue_factory.h +3 -3
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/event_string.h +3 -3
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init.h +3 -3
- data/src/core/lib/surface/init_internally.h +3 -3
- data/src/core/lib/surface/lame_client.cc +3 -1
- data/src/core/lib/surface/lame_client.h +3 -3
- data/src/core/lib/surface/server.cc +273 -27
- data/src/core/lib/surface/server.h +6 -3
- data/src/core/lib/surface/validate_metadata.h +3 -3
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +11 -0
- data/src/core/lib/transport/handshaker.h +4 -4
- data/src/core/lib/transport/handshaker_factory.h +3 -3
- data/src/core/lib/transport/handshaker_registry.h +3 -3
- data/src/core/lib/transport/http2_errors.h +3 -3
- data/src/core/lib/transport/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.cc +11 -0
- data/src/core/lib/transport/metadata_batch.h +24 -3
- data/src/core/lib/transport/parsed_metadata.h +3 -3
- data/src/core/lib/transport/pid_controller.h +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +0 -1
- data/src/core/lib/transport/tcp_connect_handshaker.h +3 -3
- data/src/core/lib/transport/timeout_encoding.h +3 -3
- data/src/core/lib/transport/transport.cc +3 -8
- data/src/core/lib/transport/transport.h +16 -8
- data/src/core/lib/transport/transport_fwd.h +3 -3
- data/src/core/lib/transport/transport_impl.h +3 -3
- data/src/core/lib/transport/transport_op_string.cc +1 -0
- data/src/core/lib/uri/uri_parser.cc +1 -1
- data/src/core/lib/uri/uri_parser.h +3 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -0
- data/src/core/tsi/alts/crypt/gsec.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_counter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +3 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +3 -3
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +3 -3
- data/src/core/tsi/fake_transport_security.h +3 -3
- data/src/core/tsi/local_transport_security.h +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -3
- data/src/core/tsi/ssl_transport_security.cc +113 -24
- data/src/core/tsi/ssl_transport_security.h +5 -3
- data/src/core/tsi/ssl_transport_security_utils.h +3 -3
- data/src/core/tsi/ssl_types.h +3 -3
- data/src/core/tsi/transport_security.h +3 -3
- data/src/core/tsi/transport_security_grpc.h +3 -3
- data/src/core/tsi/transport_security_interface.h +3 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +0 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +56 -57
- data/third_party/abseil-cpp/absl/base/attributes.h +39 -19
- data/third_party/abseil-cpp/absl/base/config.h +44 -3
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +3 -18
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +10 -6
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +23 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +2 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +4 -1
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +14 -10
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +9 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -40
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- data/third_party/abseil-cpp/absl/base/macros.h +4 -21
- data/third_party/abseil-cpp/absl/base/optimization.h +58 -6
- data/third_party/abseil-cpp/absl/base/options.h +1 -7
- data/third_party/abseil-cpp/absl/base/policy_checks.h +15 -13
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -7
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +66 -18
- data/third_party/abseil-cpp/absl/container/internal/common.h +3 -3
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +132 -0
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +13 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +4 -55
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +50 -5
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +14 -46
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +110 -32
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +155 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +661 -341
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +99 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.h +183 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +256 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +57 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +468 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +91 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +269 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +130 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +179 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +119 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +75 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +434 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +725 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +79 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +180 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +67 -38
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -13
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -9
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +40 -85
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -8
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +118 -94
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +7 -6
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +5 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +47 -26
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +10 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +18 -4
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +3 -14
- data/third_party/abseil-cpp/absl/memory/memory.h +26 -447
- data/third_party/abseil-cpp/absl/meta/type_traits.h +104 -12
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -3
- data/third_party/abseil-cpp/absl/numeric/int128.cc +10 -8
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +14 -6
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +2 -23
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +9 -9
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +2 -2
- data/third_party/abseil-cpp/absl/random/random.h +6 -6
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +1 -0
- data/third_party/abseil-cpp/absl/status/status.cc +19 -12
- data/third_party/abseil-cpp/absl/status/status.h +2 -2
- data/third_party/abseil-cpp/absl/strings/ascii.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/charconv.cc +534 -96
- data/third_party/abseil-cpp/absl/strings/cord.cc +92 -40
- data/third_party/abseil-cpp/absl/strings/cord.h +71 -80
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +8 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +73 -62
- data/third_party/abseil-cpp/absl/strings/escaping.h +24 -19
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +14 -12
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +326 -70
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +8 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +26 -14
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +9 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +7 -15
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +8 -5
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +34 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +12 -10
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +7 -9
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +55 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +14 -7
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +35 -10
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +113 -46
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +126 -29
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +4 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +49 -287
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +351 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +215 -181
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +10 -209
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +10 -101
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +34 -31
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.h +50 -3
- data/third_party/abseil-cpp/absl/strings/str_format.h +71 -9
- data/third_party/abseil-cpp/absl/strings/string_view.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -10
- data/third_party/abseil-cpp/absl/strings/substitute.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +46 -20
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +20 -17
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +37 -31
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +22 -8
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +104 -55
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +85 -46
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +0 -1
- data/third_party/abseil-cpp/absl/synchronization/notification.h +0 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +26 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +25 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +17 -11
- data/third_party/abseil-cpp/absl/time/duration.cc +7 -7
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +26 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +7 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +36 -35
- data/third_party/abseil-cpp/absl/time/time.cc +2 -2
- data/third_party/abseil-cpp/absl/time/time.h +253 -158
- data/third_party/abseil-cpp/absl/types/internal/span.h +30 -19
- data/third_party/abseil-cpp/absl/types/internal/variant.h +28 -40
- data/third_party/abseil-cpp/absl/types/span.h +29 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +1 -2
- metadata +73 -8
- data/src/core/lib/event_engine/socket_notifier.h +0 -55
- data/src/core/lib/promise/for_each.h +0 -155
- data/src/core/lib/promise/map_pipe.h +0 -88
- data/src/core/lib/promise/try_concurrently.h +0 -342
@@ -190,32 +190,32 @@ char* numbers_internal::FastIntToBuffer(uint32_t i, char* buffer) {
|
|
190
190
|
if (i >= 1000) goto lt10_000;
|
191
191
|
digits = i / 100;
|
192
192
|
i -= digits * 100;
|
193
|
-
*buffer++ = '0' + digits;
|
193
|
+
*buffer++ = '0' + static_cast<char>(digits);
|
194
194
|
goto lt100;
|
195
195
|
}
|
196
196
|
if (i < 1000000) { // 1,000,000
|
197
197
|
if (i >= 100000) goto lt1_000_000;
|
198
198
|
digits = i / 10000; // 10,000
|
199
199
|
i -= digits * 10000;
|
200
|
-
*buffer++ = '0' + digits;
|
200
|
+
*buffer++ = '0' + static_cast<char>(digits);
|
201
201
|
goto lt10_000;
|
202
202
|
}
|
203
203
|
if (i < 100000000) { // 100,000,000
|
204
204
|
if (i >= 10000000) goto lt100_000_000;
|
205
205
|
digits = i / 1000000; // 1,000,000
|
206
206
|
i -= digits * 1000000;
|
207
|
-
*buffer++ = '0' + digits;
|
207
|
+
*buffer++ = '0' + static_cast<char>(digits);
|
208
208
|
goto lt1_000_000;
|
209
209
|
}
|
210
210
|
// we already know that i < 1,000,000,000
|
211
211
|
digits = i / 100000000; // 100,000,000
|
212
212
|
i -= digits * 100000000;
|
213
|
-
*buffer++ = '0' + digits;
|
213
|
+
*buffer++ = '0' + static_cast<char>(digits);
|
214
214
|
goto lt100_000_000;
|
215
215
|
}
|
216
216
|
|
217
217
|
char* numbers_internal::FastIntToBuffer(int32_t i, char* buffer) {
|
218
|
-
uint32_t u = i;
|
218
|
+
uint32_t u = static_cast<uint32_t>(i);
|
219
219
|
if (i < 0) {
|
220
220
|
*buffer++ = '-';
|
221
221
|
// We need to do the negation in modular (i.e., "unsigned")
|
@@ -268,7 +268,7 @@ char* numbers_internal::FastIntToBuffer(uint64_t i, char* buffer) {
|
|
268
268
|
}
|
269
269
|
|
270
270
|
char* numbers_internal::FastIntToBuffer(int64_t i, char* buffer) {
|
271
|
-
uint64_t u = i;
|
271
|
+
uint64_t u = static_cast<uint64_t>(i);
|
272
272
|
if (i < 0) {
|
273
273
|
*buffer++ = '-';
|
274
274
|
u = 0 - u;
|
@@ -329,7 +329,7 @@ static std::pair<uint64_t, uint64_t> PowFive(uint64_t num, int expfive) {
|
|
329
329
|
result = Mul32(result, 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5);
|
330
330
|
expfive -= 13;
|
331
331
|
}
|
332
|
-
constexpr
|
332
|
+
constexpr uint32_t powers_of_five[13] = {
|
333
333
|
1,
|
334
334
|
5,
|
335
335
|
5 * 5,
|
@@ -404,14 +404,14 @@ static ExpDigits SplitToSix(const double value) {
|
|
404
404
|
// we multiply it by 65536 and see if the fractional part is close to 32768.
|
405
405
|
// (The number doesn't have to be a power of two,but powers of two are faster)
|
406
406
|
uint64_t d64k = d * 65536;
|
407
|
-
|
407
|
+
uint32_t dddddd; // A 6-digit decimal integer.
|
408
408
|
if ((d64k % 65536) == 32767 || (d64k % 65536) == 32768) {
|
409
409
|
// OK, it's fairly likely that precision was lost above, which is
|
410
410
|
// not a surprise given only 52 mantissa bits are available. Therefore
|
411
411
|
// redo the calculation using 128-bit numbers. (64 bits are not enough).
|
412
412
|
|
413
413
|
// Start out with digits rounded down; maybe add one below.
|
414
|
-
dddddd = static_cast<
|
414
|
+
dddddd = static_cast<uint32_t>(d64k / 65536);
|
415
415
|
|
416
416
|
// mantissa is a 64-bit integer representing M.mmm... * 2^63. The actual
|
417
417
|
// value we're representing, of course, is M.mmm... * 2^exp2.
|
@@ -461,7 +461,7 @@ static ExpDigits SplitToSix(const double value) {
|
|
461
461
|
}
|
462
462
|
} else {
|
463
463
|
// Here, we are not close to the edge.
|
464
|
-
dddddd = static_cast<
|
464
|
+
dddddd = static_cast<uint32_t>((d64k + 32768) / 65536);
|
465
465
|
}
|
466
466
|
if (dddddd == 1000000) {
|
467
467
|
dddddd = 100000;
|
@@ -469,7 +469,7 @@ static ExpDigits SplitToSix(const double value) {
|
|
469
469
|
}
|
470
470
|
exp_dig.exponent = exp;
|
471
471
|
|
472
|
-
|
472
|
+
uint32_t two_digits = dddddd / 10000;
|
473
473
|
dddddd -= two_digits * 10000;
|
474
474
|
numbers_internal::PutTwoDigits(two_digits, &exp_dig.digits[0]);
|
475
475
|
|
@@ -499,7 +499,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
499
499
|
if (std::signbit(d)) *out++ = '-';
|
500
500
|
*out++ = '0';
|
501
501
|
*out = 0;
|
502
|
-
return out - buffer;
|
502
|
+
return static_cast<size_t>(out - buffer);
|
503
503
|
}
|
504
504
|
if (d < 0) {
|
505
505
|
*out++ = '-';
|
@@ -507,7 +507,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
507
507
|
}
|
508
508
|
if (d > std::numeric_limits<double>::max()) {
|
509
509
|
strcpy(out, "inf"); // NOLINT(runtime/printf)
|
510
|
-
return out + 3 - buffer;
|
510
|
+
return static_cast<size_t>(out + 3 - buffer);
|
511
511
|
}
|
512
512
|
|
513
513
|
auto exp_dig = SplitToSix(d);
|
@@ -519,7 +519,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
519
519
|
case 5:
|
520
520
|
memcpy(out, &digits[0], 6), out += 6;
|
521
521
|
*out = 0;
|
522
|
-
return out - buffer;
|
522
|
+
return static_cast<size_t>(out - buffer);
|
523
523
|
case 4:
|
524
524
|
memcpy(out, &digits[0], 5), out += 5;
|
525
525
|
if (digits[5] != '0') {
|
@@ -527,7 +527,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
527
527
|
*out++ = digits[5];
|
528
528
|
}
|
529
529
|
*out = 0;
|
530
|
-
return out - buffer;
|
530
|
+
return static_cast<size_t>(out - buffer);
|
531
531
|
case 3:
|
532
532
|
memcpy(out, &digits[0], 4), out += 4;
|
533
533
|
if ((digits[5] | digits[4]) != '0') {
|
@@ -536,7 +536,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
536
536
|
if (digits[5] != '0') *out++ = digits[5];
|
537
537
|
}
|
538
538
|
*out = 0;
|
539
|
-
return out - buffer;
|
539
|
+
return static_cast<size_t>(out - buffer);
|
540
540
|
case 2:
|
541
541
|
memcpy(out, &digits[0], 3), out += 3;
|
542
542
|
*out++ = '.';
|
@@ -545,7 +545,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
545
545
|
while (out[-1] == '0') --out;
|
546
546
|
if (out[-1] == '.') --out;
|
547
547
|
*out = 0;
|
548
|
-
return out - buffer;
|
548
|
+
return static_cast<size_t>(out - buffer);
|
549
549
|
case 1:
|
550
550
|
memcpy(out, &digits[0], 2), out += 2;
|
551
551
|
*out++ = '.';
|
@@ -554,7 +554,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
554
554
|
while (out[-1] == '0') --out;
|
555
555
|
if (out[-1] == '.') --out;
|
556
556
|
*out = 0;
|
557
|
-
return out - buffer;
|
557
|
+
return static_cast<size_t>(out - buffer);
|
558
558
|
case 0:
|
559
559
|
memcpy(out, &digits[0], 1), out += 1;
|
560
560
|
*out++ = '.';
|
@@ -563,7 +563,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
563
563
|
while (out[-1] == '0') --out;
|
564
564
|
if (out[-1] == '.') --out;
|
565
565
|
*out = 0;
|
566
|
-
return out - buffer;
|
566
|
+
return static_cast<size_t>(out - buffer);
|
567
567
|
case -4:
|
568
568
|
out[2] = '0';
|
569
569
|
++out;
|
@@ -582,7 +582,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
582
582
|
out += 6;
|
583
583
|
while (out[-1] == '0') --out;
|
584
584
|
*out = 0;
|
585
|
-
return out - buffer;
|
585
|
+
return static_cast<size_t>(out - buffer);
|
586
586
|
}
|
587
587
|
assert(exp < -4 || exp >= 6);
|
588
588
|
out[0] = digits[0];
|
@@ -601,12 +601,12 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
|
|
601
601
|
if (exp > 99) {
|
602
602
|
int dig1 = exp / 100;
|
603
603
|
exp -= dig1 * 100;
|
604
|
-
*out++ = '0' + dig1;
|
604
|
+
*out++ = '0' + static_cast<char>(dig1);
|
605
605
|
}
|
606
|
-
PutTwoDigits(exp, out);
|
606
|
+
PutTwoDigits(static_cast<uint32_t>(exp), out);
|
607
607
|
out += 2;
|
608
608
|
*out = 0;
|
609
|
-
return out - buffer;
|
609
|
+
return static_cast<size_t>(out - buffer);
|
610
610
|
}
|
611
611
|
|
612
612
|
namespace {
|
@@ -642,10 +642,12 @@ inline bool safe_parse_sign_and_base(absl::string_view* text /*inout*/,
|
|
642
642
|
int base = *base_ptr;
|
643
643
|
|
644
644
|
// Consume whitespace.
|
645
|
-
while (start < end &&
|
645
|
+
while (start < end &&
|
646
|
+
absl::ascii_isspace(static_cast<unsigned char>(start[0]))) {
|
646
647
|
++start;
|
647
648
|
}
|
648
|
-
while (start < end &&
|
649
|
+
while (start < end &&
|
650
|
+
absl::ascii_isspace(static_cast<unsigned char>(end[-1]))) {
|
649
651
|
--end;
|
650
652
|
}
|
651
653
|
if (start >= end) {
|
@@ -694,7 +696,7 @@ inline bool safe_parse_sign_and_base(absl::string_view* text /*inout*/,
|
|
694
696
|
} else {
|
695
697
|
return false;
|
696
698
|
}
|
697
|
-
*text = absl::string_view(start, end - start);
|
699
|
+
*text = absl::string_view(start, static_cast<size_t>(end - start));
|
698
700
|
*base_ptr = base;
|
699
701
|
return true;
|
700
702
|
}
|
@@ -920,17 +922,18 @@ inline bool safe_parse_positive_int(absl::string_view text, int base,
|
|
920
922
|
const IntType vmax = std::numeric_limits<IntType>::max();
|
921
923
|
assert(vmax > 0);
|
922
924
|
assert(base >= 0);
|
923
|
-
|
925
|
+
const IntType base_inttype = static_cast<IntType>(base);
|
926
|
+
assert(vmax >= base_inttype);
|
924
927
|
const IntType vmax_over_base = LookupTables<IntType>::kVmaxOverBase[base];
|
925
928
|
assert(base < 2 ||
|
926
|
-
std::numeric_limits<IntType>::max() /
|
929
|
+
std::numeric_limits<IntType>::max() / base_inttype == vmax_over_base);
|
927
930
|
const char* start = text.data();
|
928
931
|
const char* end = start + text.size();
|
929
932
|
// loop over digits
|
930
933
|
for (; start < end; ++start) {
|
931
934
|
unsigned char c = static_cast<unsigned char>(start[0]);
|
932
|
-
|
933
|
-
if (digit >=
|
935
|
+
IntType digit = static_cast<IntType>(kAsciiToInt[c]);
|
936
|
+
if (digit >= base_inttype) {
|
934
937
|
*value_p = value;
|
935
938
|
return false;
|
936
939
|
}
|
@@ -938,7 +941,7 @@ inline bool safe_parse_positive_int(absl::string_view text, int base,
|
|
938
941
|
*value_p = vmax;
|
939
942
|
return false;
|
940
943
|
}
|
941
|
-
value *=
|
944
|
+
value *= base_inttype;
|
942
945
|
if (value > vmax - digit) {
|
943
946
|
*value_p = vmax;
|
944
947
|
return false;
|
@@ -17,12 +17,15 @@
|
|
17
17
|
#include <assert.h>
|
18
18
|
|
19
19
|
#include <algorithm>
|
20
|
+
#include <cstddef>
|
20
21
|
#include <cstdint>
|
21
22
|
#include <cstring>
|
23
|
+
#include <string>
|
22
24
|
|
23
25
|
#include "absl/strings/ascii.h"
|
24
26
|
#include "absl/strings/internal/resize_uninitialized.h"
|
25
27
|
#include "absl/strings/numbers.h"
|
28
|
+
#include "absl/strings/string_view.h"
|
26
29
|
|
27
30
|
namespace absl {
|
28
31
|
ABSL_NAMESPACE_BEGIN
|
@@ -56,7 +59,7 @@ AlphaNum::AlphaNum(Dec dec) {
|
|
56
59
|
*--writer = '0' + (value % 10);
|
57
60
|
value /= 10;
|
58
61
|
}
|
59
|
-
*--writer = '0' + value;
|
62
|
+
*--writer = '0' + static_cast<char>(value);
|
60
63
|
if (neg) *--writer = '-';
|
61
64
|
|
62
65
|
ptrdiff_t fillers = writer - minfill;
|
@@ -73,7 +76,7 @@ AlphaNum::AlphaNum(Dec dec) {
|
|
73
76
|
if (add_sign_again) *--writer = '-';
|
74
77
|
}
|
75
78
|
|
76
|
-
piece_ = absl::string_view(writer, end - writer);
|
79
|
+
piece_ = absl::string_view(writer, static_cast<size_t>(end - writer));
|
77
80
|
}
|
78
81
|
|
79
82
|
// ----------------------------------------------------------------------
|
@@ -141,12 +144,12 @@ namespace strings_internal {
|
|
141
144
|
std::string CatPieces(std::initializer_list<absl::string_view> pieces) {
|
142
145
|
std::string result;
|
143
146
|
size_t total_size = 0;
|
144
|
-
for (
|
147
|
+
for (absl::string_view piece : pieces) total_size += piece.size();
|
145
148
|
strings_internal::STLStringResizeUninitialized(&result, total_size);
|
146
149
|
|
147
150
|
char* const begin = &result[0];
|
148
151
|
char* out = begin;
|
149
|
-
for (
|
152
|
+
for (absl::string_view piece : pieces) {
|
150
153
|
const size_t this_size = piece.size();
|
151
154
|
if (this_size != 0) {
|
152
155
|
memcpy(out, piece.data(), this_size);
|
@@ -170,7 +173,7 @@ void AppendPieces(std::string* dest,
|
|
170
173
|
std::initializer_list<absl::string_view> pieces) {
|
171
174
|
size_t old_size = dest->size();
|
172
175
|
size_t total_size = old_size;
|
173
|
-
for (
|
176
|
+
for (absl::string_view piece : pieces) {
|
174
177
|
ASSERT_NO_OVERLAP(*dest, piece);
|
175
178
|
total_size += piece.size();
|
176
179
|
}
|
@@ -178,7 +181,7 @@ void AppendPieces(std::string* dest,
|
|
178
181
|
|
179
182
|
char* const begin = &(*dest)[0];
|
180
183
|
char* out = begin + old_size;
|
181
|
-
for (
|
184
|
+
for (absl::string_view piece : pieces) {
|
182
185
|
const size_t this_size = piece.size();
|
183
186
|
if (this_size != 0) {
|
184
187
|
memcpy(out, piece.data(), this_size);
|
@@ -48,6 +48,40 @@
|
|
48
48
|
// `StrCat()` or `StrAppend()`. You may specify a minimum hex field width using
|
49
49
|
// a `PadSpec` enum.
|
50
50
|
//
|
51
|
+
// User-defined types can be formatted with the `AbslStringify()` customization
|
52
|
+
// point. The API relies on detecting an overload in the user-defined type's
|
53
|
+
// namespace of a free (non-member) `AbslStringify()` function as a definition
|
54
|
+
// (typically declared as a friend and implemented in-line.
|
55
|
+
// with the following signature:
|
56
|
+
//
|
57
|
+
// class MyClass { ... };
|
58
|
+
//
|
59
|
+
// template <typename Sink>
|
60
|
+
// void AbslStringify(Sink& sink, const MyClass& value);
|
61
|
+
//
|
62
|
+
// An `AbslStringify()` overload for a type should only be declared in the same
|
63
|
+
// file and namespace as said type.
|
64
|
+
//
|
65
|
+
// Note that `AbslStringify()` also supports use with `absl::StrFormat()` and
|
66
|
+
// `absl::Substitute()`.
|
67
|
+
//
|
68
|
+
// Example:
|
69
|
+
//
|
70
|
+
// struct Point {
|
71
|
+
// // To add formatting support to `Point`, we simply need to add a free
|
72
|
+
// // (non-member) function `AbslStringify()`. This method specifies how
|
73
|
+
// // Point should be printed when absl::StrCat() is called on it. You can add
|
74
|
+
// // such a free function using a friend declaration within the body of the
|
75
|
+
// // class. The sink parameter is a templated type to avoid requiring
|
76
|
+
// // dependencies.
|
77
|
+
// template <typename Sink> friend void AbslStringify(Sink&
|
78
|
+
// sink, const Point& p) {
|
79
|
+
// absl::Format(&sink, "(%v, %v)", p.x, p.y);
|
80
|
+
// }
|
81
|
+
//
|
82
|
+
// int x;
|
83
|
+
// int y;
|
84
|
+
// };
|
51
85
|
// -----------------------------------------------------------------------------
|
52
86
|
|
53
87
|
#ifndef ABSL_STRINGS_STR_CAT_H_
|
@@ -57,9 +91,12 @@
|
|
57
91
|
#include <cstdint>
|
58
92
|
#include <string>
|
59
93
|
#include <type_traits>
|
94
|
+
#include <utility>
|
60
95
|
#include <vector>
|
61
96
|
|
62
97
|
#include "absl/base/port.h"
|
98
|
+
#include "absl/strings/internal/has_absl_stringify.h"
|
99
|
+
#include "absl/strings/internal/stringify_sink.h"
|
63
100
|
#include "absl/strings/numbers.h"
|
64
101
|
#include "absl/strings/string_view.h"
|
65
102
|
|
@@ -205,8 +242,10 @@ struct Dec {
|
|
205
242
|
// -----------------------------------------------------------------------------
|
206
243
|
//
|
207
244
|
// The `AlphaNum` class acts as the main parameter type for `StrCat()` and
|
208
|
-
// `StrAppend()`, providing efficient conversion of numeric, boolean,
|
209
|
-
// hexadecimal values (through the `Hex`
|
245
|
+
// `StrAppend()`, providing efficient conversion of numeric, boolean, decimal,
|
246
|
+
// and hexadecimal values (through the `Dec` and `Hex` types) into strings.
|
247
|
+
// `AlphaNum` should only be used as a function parameter. Do not instantiate
|
248
|
+
// `AlphaNum` directly as a stack variable.
|
210
249
|
|
211
250
|
class AlphaNum {
|
212
251
|
public:
|
@@ -255,6 +294,13 @@ class AlphaNum {
|
|
255
294
|
: piece_(NullSafeStringView(c_str)) {} // NOLINT(runtime/explicit)
|
256
295
|
AlphaNum(absl::string_view pc) : piece_(pc) {} // NOLINT(runtime/explicit)
|
257
296
|
|
297
|
+
template <typename T, typename = typename std::enable_if<
|
298
|
+
strings_internal::HasAbslStringify<T>::value>::type>
|
299
|
+
AlphaNum( // NOLINT(runtime/explicit)
|
300
|
+
const T& v, // NOLINT(runtime/explicit)
|
301
|
+
strings_internal::StringifySink&& sink = {}) // NOLINT(runtime/explicit)
|
302
|
+
: piece_(strings_internal::ExtractStringification(sink, v)) {}
|
303
|
+
|
258
304
|
template <typename Allocator>
|
259
305
|
AlphaNum( // NOLINT(runtime/explicit)
|
260
306
|
const std::basic_string<char, std::char_traits<char>, Allocator>& str)
|
@@ -274,7 +320,8 @@ class AlphaNum {
|
|
274
320
|
// This overload matches only scoped enums.
|
275
321
|
template <typename T,
|
276
322
|
typename = typename std::enable_if<
|
277
|
-
std::is_enum<T>{} && !std::is_convertible<T, int>{}
|
323
|
+
std::is_enum<T>{} && !std::is_convertible<T, int>{} &&
|
324
|
+
!strings_internal::HasAbslStringify<T>::value>::type>
|
278
325
|
AlphaNum(T e) // NOLINT(runtime/explicit)
|
279
326
|
: AlphaNum(static_cast<typename std::underlying_type<T>::type>(e)) {}
|
280
327
|
|
@@ -191,9 +191,9 @@ class FormatCountCapture {
|
|
191
191
|
// absl::StrFormat(formatString, "TheVillage", 6);
|
192
192
|
//
|
193
193
|
// A format string generally follows the POSIX syntax as used within the POSIX
|
194
|
-
// `printf` specification.
|
194
|
+
// `printf` specification. (Exceptions are noted below.)
|
195
195
|
//
|
196
|
-
// (See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html
|
196
|
+
// (See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html)
|
197
197
|
//
|
198
198
|
// In specific, the `FormatSpec` supports the following type specifiers:
|
199
199
|
// * `c` for characters
|
@@ -211,6 +211,10 @@ class FormatCountCapture {
|
|
211
211
|
// * `n` for the special case of writing out the number of characters
|
212
212
|
// written to this point. The resulting value must be captured within an
|
213
213
|
// `absl::FormatCountCapture` type.
|
214
|
+
// * `v` for values using the default format for a deduced type. These deduced
|
215
|
+
// types include many of the primitive types denoted here as well as
|
216
|
+
// user-defined types containing the proper extensions. (See below for more
|
217
|
+
// information.)
|
214
218
|
//
|
215
219
|
// Implementation-defined behavior:
|
216
220
|
// * A null pointer provided to "%s" or "%p" is output as "(nil)".
|
@@ -239,6 +243,15 @@ class FormatCountCapture {
|
|
239
243
|
// "%s%d%n", "hello", 123, absl::FormatCountCapture(&n));
|
240
244
|
// EXPECT_EQ(8, n);
|
241
245
|
//
|
246
|
+
// NOTE: the `v` specifier (for "value") is a type specifier not present in the
|
247
|
+
// POSIX specification. %v will format values according to their deduced type.
|
248
|
+
// `v` uses `d` for signed integer values, `u` for unsigned integer values, `g`
|
249
|
+
// for floating point values, and formats boolean values as "true"/"false"
|
250
|
+
// (instead of 1 or 0 for booleans formatted using d). `const char*` is not
|
251
|
+
// supported; please use `std:string` and `string_view`. `char` is also not
|
252
|
+
// supported due to ambiguity of the type. This specifier does not support
|
253
|
+
// modifiers.
|
254
|
+
//
|
242
255
|
// The `FormatSpec` intrinsically supports all of these fundamental C++ types:
|
243
256
|
//
|
244
257
|
// * Characters: `char`, `signed char`, `unsigned char`
|
@@ -570,6 +583,41 @@ ABSL_MUST_USE_RESULT inline bool FormatUntyped(
|
|
570
583
|
// StrFormat Extensions
|
571
584
|
//------------------------------------------------------------------------------
|
572
585
|
//
|
586
|
+
// AbslStringify()
|
587
|
+
//
|
588
|
+
// A simpler customization API for formatting user-defined types using
|
589
|
+
// absl::StrFormat(). The API relies on detecting an overload in the
|
590
|
+
// user-defined type's namespace of a free (non-member) `AbslStringify()`
|
591
|
+
// function as a friend definition with the following signature:
|
592
|
+
//
|
593
|
+
// template <typename Sink>
|
594
|
+
// void AbslStringify(Sink& sink, const X& value);
|
595
|
+
//
|
596
|
+
// An `AbslStringify()` overload for a type should only be declared in the same
|
597
|
+
// file and namespace as said type.
|
598
|
+
//
|
599
|
+
// Note that unlike with AbslFormatConvert(), AbslStringify() does not allow
|
600
|
+
// customization of allowed conversion characters. AbslStringify() uses `%v` as
|
601
|
+
// the underlying conversion specififer. Additionally, AbslStringify() supports
|
602
|
+
// use with absl::StrCat while AbslFormatConvert() does not.
|
603
|
+
//
|
604
|
+
// Example:
|
605
|
+
//
|
606
|
+
// struct Point {
|
607
|
+
// // To add formatting support to `Point`, we simply need to add a free
|
608
|
+
// // (non-member) function `AbslStringify()`. This method prints in the
|
609
|
+
// // request format using the underlying `%v` specifier. You can add such a
|
610
|
+
// // free function using a friend declaration within the body of the class.
|
611
|
+
// // The sink parameter is a templated type to avoid requiring dependencies.
|
612
|
+
// template <typename Sink>
|
613
|
+
// friend void AbslStringify(Sink& sink, const Point& p) {
|
614
|
+
// absl::Format(&sink, "(%v, %v)", p.x, p.y);
|
615
|
+
// }
|
616
|
+
//
|
617
|
+
// int x;
|
618
|
+
// int y;
|
619
|
+
// };
|
620
|
+
//
|
573
621
|
// AbslFormatConvert()
|
574
622
|
//
|
575
623
|
// The StrFormat library provides a customization API for formatting
|
@@ -616,9 +664,9 @@ ABSL_MUST_USE_RESULT inline bool FormatUntyped(
|
|
616
664
|
// AbslFormatConvert(const Point& p, const absl::FormatConversionSpec& spec,
|
617
665
|
// absl::FormatSink* s) {
|
618
666
|
// if (spec.conversion_char() == absl::FormatConversionChar::s) {
|
619
|
-
//
|
667
|
+
// absl::Format(s, "x=%vy=%v", p.x, p.y);
|
620
668
|
// } else {
|
621
|
-
//
|
669
|
+
// absl::Format(s, "%v,%v", p.x, p.y);
|
622
670
|
// }
|
623
671
|
// return {true};
|
624
672
|
// }
|
@@ -637,7 +685,7 @@ enum class FormatConversionChar : uint8_t {
|
|
637
685
|
c, s, // text
|
638
686
|
d, i, o, u, x, X, // int
|
639
687
|
f, F, e, E, g, G, a, A, // float
|
640
|
-
n, p
|
688
|
+
n, p, v // misc
|
641
689
|
};
|
642
690
|
// clang-format on
|
643
691
|
|
@@ -757,6 +805,7 @@ enum class FormatConversionCharSet : uint64_t {
|
|
757
805
|
// misc
|
758
806
|
n = str_format_internal::FormatConversionCharToConvInt('n'),
|
759
807
|
p = str_format_internal::FormatConversionCharToConvInt('p'),
|
808
|
+
v = str_format_internal::FormatConversionCharToConvInt('v'),
|
760
809
|
|
761
810
|
// Used for width/precision '*' specification.
|
762
811
|
kStar = static_cast<uint64_t>(
|
@@ -771,23 +820,36 @@ enum class FormatConversionCharSet : uint64_t {
|
|
771
820
|
|
772
821
|
// FormatSink
|
773
822
|
//
|
774
|
-
//
|
823
|
+
// A format sink is a generic abstraction to which conversions may write their
|
824
|
+
// formatted string data. `absl::FormatConvert()` uses this sink to write its
|
825
|
+
// formatted string.
|
775
826
|
//
|
776
827
|
class FormatSink {
|
777
828
|
public:
|
778
|
-
//
|
829
|
+
// FormatSink::Append()
|
830
|
+
//
|
831
|
+
// Appends `count` copies of `ch` to the format sink.
|
779
832
|
void Append(size_t count, char ch) { sink_->Append(count, ch); }
|
780
833
|
|
834
|
+
// Overload of FormatSink::Append() for appending the characters of a string
|
835
|
+
// view to a format sink.
|
781
836
|
void Append(string_view v) { sink_->Append(v); }
|
782
837
|
|
783
|
-
//
|
784
|
-
//
|
838
|
+
// FormatSink::PutPaddedString()
|
839
|
+
//
|
840
|
+
// Appends `precision` number of bytes of `v` to the format sink. If this is
|
841
|
+
// less than `width`, spaces will be appended first (if `left` is false), or
|
785
842
|
// after (if `left` is true) to ensure the total amount appended is
|
786
843
|
// at least `width`.
|
787
844
|
bool PutPaddedString(string_view v, int width, int precision, bool left) {
|
788
845
|
return sink_->PutPaddedString(v, width, precision, left);
|
789
846
|
}
|
790
847
|
|
848
|
+
// Support `absl::Format(&sink, format, args...)`.
|
849
|
+
friend void AbslFormatFlush(FormatSink* sink, absl::string_view v) {
|
850
|
+
sink->Append(v);
|
851
|
+
}
|
852
|
+
|
791
853
|
private:
|
792
854
|
friend str_format_internal::FormatSinkImpl;
|
793
855
|
explicit FormatSink(str_format_internal::FormatSinkImpl* s) : sink_(s) {}
|
@@ -32,7 +32,7 @@ void WritePadding(std::ostream& o, size_t pad) {
|
|
32
32
|
memset(fill_buf, o.fill(), sizeof(fill_buf));
|
33
33
|
while (pad) {
|
34
34
|
size_t n = std::min(pad, sizeof(fill_buf));
|
35
|
-
o.write(fill_buf, n);
|
35
|
+
o.write(fill_buf, static_cast<std::streamsize>(n));
|
36
36
|
pad -= n;
|
37
37
|
}
|
38
38
|
}
|
@@ -63,7 +63,7 @@ std::ostream& operator<<(std::ostream& o, string_view piece) {
|
|
63
63
|
size_t lpad = 0;
|
64
64
|
size_t rpad = 0;
|
65
65
|
if (static_cast<size_t>(o.width()) > piece.size()) {
|
66
|
-
size_t pad = o.width() - piece.size();
|
66
|
+
size_t pad = static_cast<size_t>(o.width()) - piece.size();
|
67
67
|
if ((o.flags() & o.adjustfield) == o.left) {
|
68
68
|
rpad = pad;
|
69
69
|
} else {
|
@@ -71,7 +71,7 @@ std::ostream& operator<<(std::ostream& o, string_view piece) {
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
if (lpad) WritePadding(o, lpad);
|
74
|
-
o.write(piece.data(), piece.size());
|
74
|
+
o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
|
75
75
|
if (rpad) WritePadding(o, rpad);
|
76
76
|
o.width(0);
|
77
77
|
}
|
@@ -86,7 +86,7 @@ string_view::size_type string_view::find(string_view s,
|
|
86
86
|
}
|
87
87
|
const char* result =
|
88
88
|
strings_internal::memmatch(ptr_ + pos, length_ - pos, s.ptr_, s.length_);
|
89
|
-
return result ? result - ptr_ : npos;
|
89
|
+
return result ? static_cast<size_type>(result - ptr_) : npos;
|
90
90
|
}
|
91
91
|
|
92
92
|
string_view::size_type string_view::find(char c, size_type pos) const noexcept {
|
@@ -95,7 +95,7 @@ string_view::size_type string_view::find(char c, size_type pos) const noexcept {
|
|
95
95
|
}
|
96
96
|
const char* result =
|
97
97
|
static_cast<const char*>(memchr(ptr_ + pos, c, length_ - pos));
|
98
|
-
return result != nullptr ? result - ptr_ : npos;
|
98
|
+
return result != nullptr ? static_cast<size_type>(result - ptr_) : npos;
|
99
99
|
}
|
100
100
|
|
101
101
|
string_view::size_type string_view::rfind(string_view s,
|
@@ -104,7 +104,7 @@ string_view::size_type string_view::rfind(string_view s,
|
|
104
104
|
if (s.empty()) return std::min(length_, pos);
|
105
105
|
const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_;
|
106
106
|
const char* result = std::find_end(ptr_, last, s.ptr_, s.ptr_ + s.length_);
|
107
|
-
return result != last ? result - ptr_ : npos;
|
107
|
+
return result != last ? static_cast<size_type>(result - ptr_) : npos;
|
108
108
|
}
|
109
109
|
|
110
110
|
// Search range is [0..pos] inclusive. If pos == npos, search everything.
|
@@ -63,12 +63,6 @@ ABSL_NAMESPACE_END
|
|
63
63
|
#define ABSL_INTERNAL_STRING_VIEW_MEMCMP memcmp
|
64
64
|
#endif // ABSL_HAVE_BUILTIN(__builtin_memcmp)
|
65
65
|
|
66
|
-
#if defined(__cplusplus) && __cplusplus >= 201402L
|
67
|
-
#define ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR constexpr
|
68
|
-
#else
|
69
|
-
#define ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR
|
70
|
-
#endif
|
71
|
-
|
72
66
|
namespace absl {
|
73
67
|
ABSL_NAMESPACE_BEGIN
|
74
68
|
|
@@ -341,7 +335,7 @@ class string_view {
|
|
341
335
|
//
|
342
336
|
// Removes the first `n` characters from the `string_view`. Note that the
|
343
337
|
// underlying string is not changed, only the view.
|
344
|
-
|
338
|
+
constexpr void remove_prefix(size_type n) {
|
345
339
|
ABSL_HARDENING_ASSERT(n <= length_);
|
346
340
|
ptr_ += n;
|
347
341
|
length_ -= n;
|
@@ -351,7 +345,7 @@ class string_view {
|
|
351
345
|
//
|
352
346
|
// Removes the last `n` characters from the `string_view`. Note that the
|
353
347
|
// underlying string is not changed, only the view.
|
354
|
-
|
348
|
+
constexpr void remove_suffix(size_type n) {
|
355
349
|
ABSL_HARDENING_ASSERT(n <= length_);
|
356
350
|
length_ -= n;
|
357
351
|
}
|
@@ -359,7 +353,7 @@ class string_view {
|
|
359
353
|
// string_view::swap()
|
360
354
|
//
|
361
355
|
// Swaps this `string_view` with another `string_view`.
|
362
|
-
|
356
|
+
constexpr void swap(string_view& s) noexcept {
|
363
357
|
auto t = *this;
|
364
358
|
*this = s;
|
365
359
|
s = t;
|
@@ -678,7 +672,6 @@ std::ostream& operator<<(std::ostream& o, string_view piece);
|
|
678
672
|
ABSL_NAMESPACE_END
|
679
673
|
} // namespace absl
|
680
674
|
|
681
|
-
#undef ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR
|
682
675
|
#undef ABSL_INTERNAL_STRING_VIEW_MEMCMP
|
683
676
|
|
684
677
|
#endif // ABSL_USES_STD_STRING_VIEW
|