grpc 1.52.0 → 1.53.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- 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/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 +75 -10
- 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
@@ -20,6 +20,7 @@
|
|
20
20
|
#include <cstdio>
|
21
21
|
#include <cstdlib>
|
22
22
|
#include <iomanip>
|
23
|
+
#include <ios>
|
23
24
|
#include <iostream>
|
24
25
|
#include <limits>
|
25
26
|
#include <ostream>
|
@@ -34,6 +35,7 @@
|
|
34
35
|
#include "absl/base/port.h"
|
35
36
|
#include "absl/container/fixed_array.h"
|
36
37
|
#include "absl/container/inlined_vector.h"
|
38
|
+
#include "absl/crc/internal/crc_cord_state.h"
|
37
39
|
#include "absl/strings/cord_buffer.h"
|
38
40
|
#include "absl/strings/escaping.h"
|
39
41
|
#include "absl/strings/internal/cord_data_edge.h"
|
@@ -166,9 +168,7 @@ constexpr unsigned char Cord::InlineRep::kMaxInline;
|
|
166
168
|
|
167
169
|
inline void Cord::InlineRep::set_data(const char* data, size_t n) {
|
168
170
|
static_assert(kMaxInline == 15, "set_data is hard-coded for a length of 15");
|
169
|
-
|
170
|
-
cord_internal::SmallMemmove<true>(data_.as_chars(), data, n);
|
171
|
-
set_inline_size(n);
|
171
|
+
data_.set_inline_data(data, n);
|
172
172
|
}
|
173
173
|
|
174
174
|
inline char* Cord::InlineRep::set_data(size_t n) {
|
@@ -184,7 +184,7 @@ inline void Cord::InlineRep::reduce_size(size_t n) {
|
|
184
184
|
assert(tag >= n);
|
185
185
|
tag -= n;
|
186
186
|
memset(data_.as_chars() + tag, 0, n);
|
187
|
-
set_inline_size(
|
187
|
+
set_inline_size(tag);
|
188
188
|
}
|
189
189
|
|
190
190
|
inline void Cord::InlineRep::remove_prefix(size_t n) {
|
@@ -419,6 +419,7 @@ Cord& Cord::operator=(absl::string_view src) {
|
|
419
419
|
// we keep it here to make diffs easier.
|
420
420
|
void Cord::InlineRep::AppendArray(absl::string_view src,
|
421
421
|
MethodIdentifier method) {
|
422
|
+
MaybeRemoveEmptyCrcNode();
|
422
423
|
if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
|
423
424
|
|
424
425
|
size_t appended = 0;
|
@@ -436,8 +437,8 @@ void Cord::InlineRep::AppendArray(absl::string_view src,
|
|
436
437
|
size_t inline_length = inline_size();
|
437
438
|
if (src.size() <= kMaxInline - inline_length) {
|
438
439
|
// Append new data to embedded array
|
439
|
-
memcpy(data_.as_chars() + inline_length, src.data(), src.size());
|
440
440
|
set_inline_size(inline_length + src.size());
|
441
|
+
memcpy(data_.as_chars() + inline_length, src.data(), src.size());
|
441
442
|
return;
|
442
443
|
}
|
443
444
|
|
@@ -478,6 +479,10 @@ inline CordRep* Cord::TakeRep() && {
|
|
478
479
|
template <typename C>
|
479
480
|
inline void Cord::AppendImpl(C&& src) {
|
480
481
|
auto constexpr method = CordzUpdateTracker::kAppendCord;
|
482
|
+
|
483
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
484
|
+
if (src.empty()) return;
|
485
|
+
|
481
486
|
if (empty()) {
|
482
487
|
// Since destination is empty, we can avoid allocating a node,
|
483
488
|
if (src.contents_.is_tree()) {
|
@@ -537,18 +542,23 @@ static CordRep::ExtractResult ExtractAppendBuffer(CordRep* rep,
|
|
537
542
|
}
|
538
543
|
}
|
539
544
|
|
540
|
-
static CordBuffer CreateAppendBuffer(InlineData& data, size_t
|
545
|
+
static CordBuffer CreateAppendBuffer(InlineData& data, size_t block_size,
|
546
|
+
size_t capacity) {
|
541
547
|
// Watch out for overflow, people can ask for size_t::max().
|
542
548
|
const size_t size = data.inline_size();
|
543
|
-
|
544
|
-
|
549
|
+
const size_t max_capacity = std::numeric_limits<size_t>::max() - size;
|
550
|
+
capacity = (std::min)(max_capacity, capacity) + size;
|
551
|
+
CordBuffer buffer =
|
552
|
+
block_size ? CordBuffer::CreateWithCustomLimit(block_size, capacity)
|
553
|
+
: CordBuffer::CreateWithDefaultLimit(capacity);
|
545
554
|
cord_internal::SmallMemmove(buffer.data(), data.as_chars(), size);
|
546
555
|
buffer.SetLength(size);
|
547
556
|
data = {};
|
548
557
|
return buffer;
|
549
558
|
}
|
550
559
|
|
551
|
-
CordBuffer Cord::GetAppendBufferSlowPath(size_t
|
560
|
+
CordBuffer Cord::GetAppendBufferSlowPath(size_t block_size, size_t capacity,
|
561
|
+
size_t min_capacity) {
|
552
562
|
auto constexpr method = CordzUpdateTracker::kGetAppendBuffer;
|
553
563
|
CordRep* tree = contents_.tree();
|
554
564
|
if (tree != nullptr) {
|
@@ -558,9 +568,10 @@ CordBuffer Cord::GetAppendBufferSlowPath(size_t capacity, size_t min_capacity) {
|
|
558
568
|
contents_.SetTreeOrEmpty(result.tree, scope);
|
559
569
|
return CordBuffer(result.extracted->flat());
|
560
570
|
}
|
561
|
-
return CordBuffer::
|
571
|
+
return block_size ? CordBuffer::CreateWithCustomLimit(block_size, capacity)
|
572
|
+
: CordBuffer::CreateWithDefaultLimit(capacity);
|
562
573
|
}
|
563
|
-
return CreateAppendBuffer(contents_.data_, capacity);
|
574
|
+
return CreateAppendBuffer(contents_.data_, block_size, capacity);
|
564
575
|
}
|
565
576
|
|
566
577
|
void Cord::Append(const Cord& src) {
|
@@ -584,6 +595,9 @@ void Cord::Append(T&& src) {
|
|
584
595
|
template void Cord::Append(std::string&& src);
|
585
596
|
|
586
597
|
void Cord::Prepend(const Cord& src) {
|
598
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
599
|
+
if (src.empty()) return;
|
600
|
+
|
587
601
|
CordRep* src_tree = src.contents_.tree();
|
588
602
|
if (src_tree != nullptr) {
|
589
603
|
CordRep::Ref(src_tree);
|
@@ -598,16 +612,18 @@ void Cord::Prepend(const Cord& src) {
|
|
598
612
|
}
|
599
613
|
|
600
614
|
void Cord::PrependArray(absl::string_view src, MethodIdentifier method) {
|
615
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
601
616
|
if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
|
617
|
+
|
602
618
|
if (!contents_.is_tree()) {
|
603
619
|
size_t cur_size = contents_.inline_size();
|
604
620
|
if (cur_size + src.size() <= InlineRep::kMaxInline) {
|
605
621
|
// Use embedded storage.
|
606
|
-
|
607
|
-
|
608
|
-
memcpy(data
|
609
|
-
memcpy(
|
610
|
-
contents_.
|
622
|
+
InlineData data;
|
623
|
+
data.set_inline_size(cur_size + src.size());
|
624
|
+
memcpy(data.as_chars(), src.data(), src.size());
|
625
|
+
memcpy(data.as_chars() + src.size(), contents_.data(), cur_size);
|
626
|
+
contents_.data_ = data;
|
611
627
|
return;
|
612
628
|
}
|
613
629
|
}
|
@@ -620,8 +636,8 @@ void Cord::AppendPrecise(absl::string_view src, MethodIdentifier method) {
|
|
620
636
|
assert(src.size() <= cord_internal::kMaxFlatLength);
|
621
637
|
if (contents_.remaining_inline_capacity() >= src.size()) {
|
622
638
|
const size_t inline_length = contents_.inline_size();
|
623
|
-
memcpy(contents_.data_.as_chars() + inline_length, src.data(), src.size());
|
624
639
|
contents_.set_inline_size(inline_length + src.size());
|
640
|
+
memcpy(contents_.data_.as_chars() + inline_length, src.data(), src.size());
|
625
641
|
} else {
|
626
642
|
contents_.AppendTree(CordRepFlat::Create(src), method);
|
627
643
|
}
|
@@ -631,12 +647,12 @@ void Cord::PrependPrecise(absl::string_view src, MethodIdentifier method) {
|
|
631
647
|
assert(!src.empty());
|
632
648
|
assert(src.size() <= cord_internal::kMaxFlatLength);
|
633
649
|
if (contents_.remaining_inline_capacity() >= src.size()) {
|
634
|
-
const size_t
|
635
|
-
|
636
|
-
|
637
|
-
memcpy(data
|
638
|
-
memcpy(
|
639
|
-
contents_.
|
650
|
+
const size_t cur_size = contents_.inline_size();
|
651
|
+
InlineData data;
|
652
|
+
data.set_inline_size(cur_size + src.size());
|
653
|
+
memcpy(data.as_chars(), src.data(), src.size());
|
654
|
+
memcpy(data.as_chars() + src.size(), contents_.data(), cur_size);
|
655
|
+
contents_.data_ = data;
|
640
656
|
} else {
|
641
657
|
contents_.PrependTree(CordRepFlat::Create(src), method);
|
642
658
|
}
|
@@ -658,6 +674,7 @@ void Cord::RemovePrefix(size_t n) {
|
|
658
674
|
ABSL_INTERNAL_CHECK(n <= size(),
|
659
675
|
absl::StrCat("Requested prefix size ", n,
|
660
676
|
" exceeds Cord's size ", size()));
|
677
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
661
678
|
CordRep* tree = contents_.tree();
|
662
679
|
if (tree == nullptr) {
|
663
680
|
contents_.remove_prefix(n);
|
@@ -688,6 +705,7 @@ void Cord::RemoveSuffix(size_t n) {
|
|
688
705
|
ABSL_INTERNAL_CHECK(n <= size(),
|
689
706
|
absl::StrCat("Requested suffix size ", n,
|
690
707
|
" exceeds Cord's size ", size()));
|
708
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
691
709
|
CordRep* tree = contents_.tree();
|
692
710
|
if (tree == nullptr) {
|
693
711
|
contents_.reduce_size(n);
|
@@ -726,6 +744,7 @@ Cord Cord::Subcord(size_t pos, size_t new_size) const {
|
|
726
744
|
}
|
727
745
|
|
728
746
|
if (new_size <= InlineRep::kMaxInline) {
|
747
|
+
sub_cord.contents_.set_inline_size(new_size);
|
729
748
|
char* dest = sub_cord.contents_.data_.as_chars();
|
730
749
|
Cord::ChunkIterator it = chunk_begin();
|
731
750
|
it.AdvanceBytes(pos);
|
@@ -737,7 +756,6 @@ Cord Cord::Subcord(size_t pos, size_t new_size) const {
|
|
737
756
|
++it;
|
738
757
|
}
|
739
758
|
cord_internal::SmallMemmove(dest, it->data(), remaining_size);
|
740
|
-
sub_cord.contents_.set_inline_size(new_size);
|
741
759
|
return sub_cord;
|
742
760
|
}
|
743
761
|
|
@@ -835,26 +853,44 @@ inline absl::string_view Cord::InlineRep::FindFlatStartPiece() const {
|
|
835
853
|
return absl::string_view(node->external()->base + offset, length);
|
836
854
|
}
|
837
855
|
|
838
|
-
void Cord::
|
856
|
+
void Cord::SetCrcCordState(crc_internal::CrcCordState state) {
|
839
857
|
auto constexpr method = CordzUpdateTracker::kSetExpectedChecksum;
|
840
|
-
if (empty())
|
841
|
-
|
842
|
-
|
858
|
+
if (empty()) {
|
859
|
+
contents_.MaybeRemoveEmptyCrcNode();
|
860
|
+
CordRep* rep = CordRepCrc::New(nullptr, std::move(state));
|
861
|
+
contents_.EmplaceTree(rep, method);
|
862
|
+
} else if (!contents_.is_tree()) {
|
843
863
|
CordRep* rep = contents_.MakeFlatWithExtraCapacity(0);
|
844
|
-
rep = CordRepCrc::New(rep,
|
864
|
+
rep = CordRepCrc::New(rep, std::move(state));
|
845
865
|
contents_.EmplaceTree(rep, method);
|
846
866
|
} else {
|
847
867
|
const CordzUpdateScope scope(contents_.data_.cordz_info(), method);
|
848
|
-
CordRep* rep = CordRepCrc::New(contents_.data_.as_tree(),
|
868
|
+
CordRep* rep = CordRepCrc::New(contents_.data_.as_tree(), std::move(state));
|
849
869
|
contents_.SetTree(rep, scope);
|
850
870
|
}
|
851
871
|
}
|
852
872
|
|
873
|
+
void Cord::SetExpectedChecksum(uint32_t crc) {
|
874
|
+
// Construct a CrcCordState with a single chunk.
|
875
|
+
crc_internal::CrcCordState state;
|
876
|
+
state.mutable_rep()->prefix_crc.push_back(
|
877
|
+
crc_internal::CrcCordState::PrefixCrc(size(), absl::crc32c_t{crc}));
|
878
|
+
SetCrcCordState(std::move(state));
|
879
|
+
}
|
880
|
+
|
881
|
+
const crc_internal::CrcCordState* Cord::MaybeGetCrcCordState() const {
|
882
|
+
if (!contents_.is_tree() || !contents_.tree()->IsCrc()) {
|
883
|
+
return nullptr;
|
884
|
+
}
|
885
|
+
return &contents_.tree()->crc()->crc_cord_state;
|
886
|
+
}
|
887
|
+
|
853
888
|
absl::optional<uint32_t> Cord::ExpectedChecksum() const {
|
854
889
|
if (!contents_.is_tree() || !contents_.tree()->IsCrc()) {
|
855
890
|
return absl::nullopt;
|
856
891
|
}
|
857
|
-
return
|
892
|
+
return static_cast<uint32_t>(
|
893
|
+
contents_.tree()->crc()->crc_cord_state.Checksum());
|
858
894
|
}
|
859
895
|
|
860
896
|
inline int Cord::CompareSlowPath(absl::string_view rhs, size_t compared_size,
|
@@ -922,6 +958,7 @@ inline int Cord::CompareSlowPath(const Cord& rhs, size_t compared_size,
|
|
922
958
|
}
|
923
959
|
|
924
960
|
inline absl::string_view Cord::GetFirstChunk(const Cord& c) {
|
961
|
+
if (c.empty()) return {};
|
925
962
|
return c.contents_.FindFlatStartPiece();
|
926
963
|
}
|
927
964
|
inline absl::string_view Cord::GetFirstChunk(absl::string_view sv) {
|
@@ -1092,7 +1129,7 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
|
|
1092
1129
|
: current_leaf_;
|
1093
1130
|
const char* data = payload->IsExternal() ? payload->external()->base
|
1094
1131
|
: payload->flat()->Data();
|
1095
|
-
const size_t offset = current_chunk_.data() - data;
|
1132
|
+
const size_t offset = static_cast<size_t>(current_chunk_.data() - data);
|
1096
1133
|
|
1097
1134
|
auto* tree = CordRepSubstring::Substring(payload, offset, n);
|
1098
1135
|
subcord.contents_.EmplaceTree(VerifyTree(tree), method);
|
@@ -1159,6 +1196,10 @@ absl::string_view Cord::FlattenSlowPath() {
|
|
1159
1196
|
|
1160
1197
|
/* static */ bool Cord::GetFlatAux(CordRep* rep, absl::string_view* fragment) {
|
1161
1198
|
assert(rep != nullptr);
|
1199
|
+
if (rep->length == 0) {
|
1200
|
+
*fragment = absl::string_view();
|
1201
|
+
return true;
|
1202
|
+
}
|
1162
1203
|
rep = cord_internal::SkipCrcNode(rep);
|
1163
1204
|
if (rep->IsFlat()) {
|
1164
1205
|
*fragment = absl::string_view(rep->flat()->Data(), rep->length);
|
@@ -1190,6 +1231,7 @@ absl::string_view Cord::FlattenSlowPath() {
|
|
1190
1231
|
absl::cord_internal::CordRep* rep,
|
1191
1232
|
absl::FunctionRef<void(absl::string_view)> callback) {
|
1192
1233
|
assert(rep != nullptr);
|
1234
|
+
if (rep->length == 0) return;
|
1193
1235
|
rep = cord_internal::SkipCrcNode(rep);
|
1194
1236
|
|
1195
1237
|
if (rep->IsBtree()) {
|
@@ -1223,8 +1265,12 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
|
|
1223
1265
|
if (include_data) *os << static_cast<void*>(rep);
|
1224
1266
|
*os << "]";
|
1225
1267
|
*os << " " << std::setw(indent) << "";
|
1226
|
-
|
1227
|
-
|
1268
|
+
bool leaf = false;
|
1269
|
+
if (rep == nullptr) {
|
1270
|
+
*os << "NULL\n";
|
1271
|
+
leaf = true;
|
1272
|
+
} else if (rep->IsCrc()) {
|
1273
|
+
*os << "CRC crc=" << rep->crc()->crc_cord_state.Checksum() << "\n";
|
1228
1274
|
indent += kIndentStep;
|
1229
1275
|
rep = rep->crc()->child;
|
1230
1276
|
} else if (rep->IsSubstring()) {
|
@@ -1232,6 +1278,7 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
|
|
1232
1278
|
indent += kIndentStep;
|
1233
1279
|
rep = rep->substring()->child;
|
1234
1280
|
} else { // Leaf or ring
|
1281
|
+
leaf = true;
|
1235
1282
|
if (rep->IsExternal()) {
|
1236
1283
|
*os << "EXTERNAL [";
|
1237
1284
|
if (include_data)
|
@@ -1245,6 +1292,8 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
|
|
1245
1292
|
} else {
|
1246
1293
|
CordRepBtree::Dump(rep, /*label=*/ "", include_data, *os);
|
1247
1294
|
}
|
1295
|
+
}
|
1296
|
+
if (leaf) {
|
1248
1297
|
if (stack.empty()) break;
|
1249
1298
|
rep = stack.back();
|
1250
1299
|
stack.pop_back();
|
@@ -1290,11 +1339,14 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
|
|
1290
1339
|
node->substring()->child->length,
|
1291
1340
|
ReportError(root, node));
|
1292
1341
|
} else if (node->IsCrc()) {
|
1293
|
-
ABSL_INTERNAL_CHECK(
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1342
|
+
ABSL_INTERNAL_CHECK(
|
1343
|
+
node->crc()->child != nullptr || node->crc()->length == 0,
|
1344
|
+
ReportError(root, node));
|
1345
|
+
if (node->crc()->child != nullptr) {
|
1346
|
+
ABSL_INTERNAL_CHECK(node->crc()->length == node->crc()->child->length,
|
1347
|
+
ReportError(root, node));
|
1348
|
+
worklist.push_back(node->crc()->child);
|
1349
|
+
}
|
1298
1350
|
}
|
1299
1351
|
} while (!worklist.empty());
|
1300
1352
|
return true;
|
@@ -1302,7 +1354,7 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
|
|
1302
1354
|
|
1303
1355
|
std::ostream& operator<<(std::ostream& out, const Cord& cord) {
|
1304
1356
|
for (absl::string_view chunk : cord.Chunks()) {
|
1305
|
-
out.write(chunk.data(), chunk.size());
|
1357
|
+
out.write(chunk.data(), static_cast<std::streamsize>(chunk.size()));
|
1306
1358
|
}
|
1307
1359
|
return out;
|
1308
1360
|
}
|
@@ -20,8 +20,7 @@
|
|
20
20
|
// structure. A Cord is a string-like sequence of characters optimized for
|
21
21
|
// specific use cases. Unlike a `std::string`, which stores an array of
|
22
22
|
// contiguous characters, Cord data is stored in a structure consisting of
|
23
|
-
// separate, reference-counted "chunks."
|
24
|
-
// tree structure, though that implementation may change.)
|
23
|
+
// separate, reference-counted "chunks."
|
25
24
|
//
|
26
25
|
// Because a Cord consists of these chunks, data can be added to or removed from
|
27
26
|
// a Cord during its lifetime. Chunks may also be shared between Cords. Unlike a
|
@@ -77,6 +76,7 @@
|
|
77
76
|
#include "absl/base/macros.h"
|
78
77
|
#include "absl/base/port.h"
|
79
78
|
#include "absl/container/inlined_vector.h"
|
79
|
+
#include "absl/crc/internal/crc_cord_state.h"
|
80
80
|
#include "absl/functional/function_ref.h"
|
81
81
|
#include "absl/meta/type_traits.h"
|
82
82
|
#include "absl/strings/cord_analysis.h"
|
@@ -284,6 +284,19 @@ class Cord {
|
|
284
284
|
// }
|
285
285
|
CordBuffer GetAppendBuffer(size_t capacity, size_t min_capacity = 16);
|
286
286
|
|
287
|
+
// Returns a CordBuffer, re-using potential existing capacity in this cord.
|
288
|
+
//
|
289
|
+
// This function is identical to `GetAppendBuffer`, except that in the case
|
290
|
+
// where a new `CordBuffer` is allocated, it is allocated using the provided
|
291
|
+
// custom limit instead of the default limit. `GetAppendBuffer` will default
|
292
|
+
// to `CordBuffer::CreateWithDefaultLimit(capacity)` whereas this method
|
293
|
+
// will default to `CordBuffer::CreateWithCustomLimit(block_size, capacity)`.
|
294
|
+
// This method is equivalent to `GetAppendBuffer` if `block_size` is zero.
|
295
|
+
// See the documentation for `CreateWithCustomLimit` for more details on the
|
296
|
+
// restrictions and legal values for `block_size`.
|
297
|
+
CordBuffer GetCustomAppendBuffer(size_t block_size, size_t capacity,
|
298
|
+
size_t min_capacity = 16);
|
299
|
+
|
287
300
|
// Cord::Prepend()
|
288
301
|
//
|
289
302
|
// Prepends data to the Cord, which may come from another Cord or other string
|
@@ -802,7 +815,7 @@ class Cord {
|
|
802
815
|
InlineRep& operator=(const InlineRep& src);
|
803
816
|
InlineRep& operator=(InlineRep&& src) noexcept;
|
804
817
|
|
805
|
-
explicit constexpr InlineRep(
|
818
|
+
explicit constexpr InlineRep(absl::string_view sv, CordRep* rep);
|
806
819
|
|
807
820
|
void Swap(InlineRep* rhs);
|
808
821
|
bool empty() const;
|
@@ -861,33 +874,14 @@ class Cord {
|
|
861
874
|
void PrependTreeToTree(CordRep* tree, MethodIdentifier method);
|
862
875
|
void PrependTree(CordRep* tree, MethodIdentifier method);
|
863
876
|
|
864
|
-
|
865
|
-
void GetAppendRegion(char** region, size_t* size, size_t length);
|
877
|
+
bool IsSame(const InlineRep& other) const { return data_ == other.data_; }
|
866
878
|
|
867
|
-
bool IsSame(const InlineRep& other) const {
|
868
|
-
return memcmp(&data_, &other.data_, sizeof(data_)) == 0;
|
869
|
-
}
|
870
|
-
int BitwiseCompare(const InlineRep& other) const {
|
871
|
-
uint64_t x, y;
|
872
|
-
// Use memcpy to avoid aliasing issues.
|
873
|
-
memcpy(&x, &data_, sizeof(x));
|
874
|
-
memcpy(&y, &other.data_, sizeof(y));
|
875
|
-
if (x == y) {
|
876
|
-
memcpy(&x, reinterpret_cast<const char*>(&data_) + 8, sizeof(x));
|
877
|
-
memcpy(&y, reinterpret_cast<const char*>(&other.data_) + 8, sizeof(y));
|
878
|
-
if (x == y) return 0;
|
879
|
-
}
|
880
|
-
return absl::big_endian::FromHost64(x) < absl::big_endian::FromHost64(y)
|
881
|
-
? -1
|
882
|
-
: 1;
|
883
|
-
}
|
884
879
|
void CopyTo(std::string* dst) const {
|
885
880
|
// memcpy is much faster when operating on a known size. On most supported
|
886
881
|
// platforms, the small string optimization is large enough that resizing
|
887
882
|
// to 15 bytes does not cause a memory allocation.
|
888
|
-
absl::strings_internal::STLStringResizeUninitialized(dst,
|
889
|
-
|
890
|
-
memcpy(&(*dst)[0], &data_, sizeof(data_) - 1);
|
883
|
+
absl::strings_internal::STLStringResizeUninitialized(dst, kMaxInline);
|
884
|
+
data_.copy_max_inline_to(&(*dst)[0]);
|
891
885
|
// erase is faster than resize because the logic for memory allocation is
|
892
886
|
// not needed.
|
893
887
|
dst->erase(inline_size());
|
@@ -932,6 +926,13 @@ class Cord {
|
|
932
926
|
void set_inline_size(size_t size) { data_.set_inline_size(size); }
|
933
927
|
size_t inline_size() const { return data_.inline_size(); }
|
934
928
|
|
929
|
+
// Empty cords that carry a checksum have a CordRepCrc node with a null
|
930
|
+
// child node. The code can avoid lots of special cases where it would
|
931
|
+
// otherwise transition from tree to inline storage if we just remove the
|
932
|
+
// CordRepCrc node before mutations. Must never be called inside a
|
933
|
+
// CordzUpdateScope since it untracks the cordz info.
|
934
|
+
void MaybeRemoveEmptyCrcNode();
|
935
|
+
|
935
936
|
cord_internal::InlineData data_;
|
936
937
|
};
|
937
938
|
InlineRep contents_;
|
@@ -980,7 +981,8 @@ class Cord {
|
|
980
981
|
void AppendPrecise(absl::string_view src, MethodIdentifier method);
|
981
982
|
void PrependPrecise(absl::string_view src, MethodIdentifier method);
|
982
983
|
|
983
|
-
CordBuffer GetAppendBufferSlowPath(size_t
|
984
|
+
CordBuffer GetAppendBufferSlowPath(size_t block_size, size_t capacity,
|
985
|
+
size_t min_capacity);
|
984
986
|
|
985
987
|
// Prepends the provided data to this instance. `method` contains the public
|
986
988
|
// API method for this action which is tracked for Cordz sampling purposes.
|
@@ -1000,6 +1002,10 @@ class Cord {
|
|
1000
1002
|
});
|
1001
1003
|
return H::combine(combiner.finalize(std::move(hash_state)), size());
|
1002
1004
|
}
|
1005
|
+
|
1006
|
+
friend class CrcCord;
|
1007
|
+
void SetCrcCordState(crc_internal::CrcCordState state);
|
1008
|
+
const crc_internal::CrcCordState* MaybeGetCrcCordState() const;
|
1003
1009
|
};
|
1004
1010
|
|
1005
1011
|
ABSL_NAMESPACE_END
|
@@ -1016,46 +1022,6 @@ extern std::ostream& operator<<(std::ostream& out, const Cord& cord);
|
|
1016
1022
|
|
1017
1023
|
namespace cord_internal {
|
1018
1024
|
|
1019
|
-
// Fast implementation of memmove for up to 15 bytes. This implementation is
|
1020
|
-
// safe for overlapping regions. If nullify_tail is true, the destination is
|
1021
|
-
// padded with '\0' up to 16 bytes.
|
1022
|
-
template <bool nullify_tail = false>
|
1023
|
-
inline void SmallMemmove(char* dst, const char* src, size_t n) {
|
1024
|
-
if (n >= 8) {
|
1025
|
-
assert(n <= 16);
|
1026
|
-
uint64_t buf1;
|
1027
|
-
uint64_t buf2;
|
1028
|
-
memcpy(&buf1, src, 8);
|
1029
|
-
memcpy(&buf2, src + n - 8, 8);
|
1030
|
-
if (nullify_tail) {
|
1031
|
-
memset(dst + 8, 0, 8);
|
1032
|
-
}
|
1033
|
-
memcpy(dst, &buf1, 8);
|
1034
|
-
memcpy(dst + n - 8, &buf2, 8);
|
1035
|
-
} else if (n >= 4) {
|
1036
|
-
uint32_t buf1;
|
1037
|
-
uint32_t buf2;
|
1038
|
-
memcpy(&buf1, src, 4);
|
1039
|
-
memcpy(&buf2, src + n - 4, 4);
|
1040
|
-
if (nullify_tail) {
|
1041
|
-
memset(dst + 4, 0, 4);
|
1042
|
-
memset(dst + 8, 0, 8);
|
1043
|
-
}
|
1044
|
-
memcpy(dst, &buf1, 4);
|
1045
|
-
memcpy(dst + n - 4, &buf2, 4);
|
1046
|
-
} else {
|
1047
|
-
if (n != 0) {
|
1048
|
-
dst[0] = src[0];
|
1049
|
-
dst[n / 2] = src[n / 2];
|
1050
|
-
dst[n - 1] = src[n - 1];
|
1051
|
-
}
|
1052
|
-
if (nullify_tail) {
|
1053
|
-
memset(dst + 8, 0, 8);
|
1054
|
-
memset(dst + n, 0, 8);
|
1055
|
-
}
|
1056
|
-
}
|
1057
|
-
}
|
1058
|
-
|
1059
1025
|
// Does non-template-specific `CordRepExternal` initialization.
|
1060
1026
|
// Requires `data` to be non-empty.
|
1061
1027
|
void InitializeCordRepExternal(absl::string_view data, CordRepExternal* rep);
|
@@ -1099,8 +1065,8 @@ Cord MakeCordFromExternal(absl::string_view data, Releaser&& releaser) {
|
|
1099
1065
|
return cord;
|
1100
1066
|
}
|
1101
1067
|
|
1102
|
-
constexpr Cord::InlineRep::InlineRep(
|
1103
|
-
: data_(
|
1068
|
+
constexpr Cord::InlineRep::InlineRep(absl::string_view sv, CordRep* rep)
|
1069
|
+
: data_(sv, rep) {}
|
1104
1070
|
|
1105
1071
|
inline Cord::InlineRep::InlineRep(const Cord::InlineRep& src)
|
1106
1072
|
: data_(InlineData::kDefaultInit) {
|
@@ -1179,7 +1145,7 @@ inline cord_internal::CordRepFlat* Cord::InlineRep::MakeFlatWithExtraCapacity(
|
|
1179
1145
|
size_t len = data_.inline_size();
|
1180
1146
|
auto* result = CordRepFlat::New(len + extra);
|
1181
1147
|
result->length = len;
|
1182
|
-
|
1148
|
+
data_.copy_max_inline_to(result->Data());
|
1183
1149
|
return result;
|
1184
1150
|
}
|
1185
1151
|
|
@@ -1241,6 +1207,18 @@ inline void Cord::InlineRep::CopyToArray(char* dst) const {
|
|
1241
1207
|
cord_internal::SmallMemmove(dst, data_.as_chars(), n);
|
1242
1208
|
}
|
1243
1209
|
|
1210
|
+
inline void Cord::InlineRep::MaybeRemoveEmptyCrcNode() {
|
1211
|
+
CordRep* rep = tree();
|
1212
|
+
if (rep == nullptr || ABSL_PREDICT_TRUE(rep->length > 0)) {
|
1213
|
+
return;
|
1214
|
+
}
|
1215
|
+
assert(rep->IsCrc());
|
1216
|
+
assert(rep->crc()->child == nullptr);
|
1217
|
+
CordzInfo::MaybeUntrackCord(cordz_info());
|
1218
|
+
CordRep::Unref(rep);
|
1219
|
+
ResetToEmpty();
|
1220
|
+
}
|
1221
|
+
|
1244
1222
|
constexpr inline Cord::Cord() noexcept {}
|
1245
1223
|
|
1246
1224
|
inline Cord::Cord(absl::string_view src)
|
@@ -1248,13 +1226,12 @@ inline Cord::Cord(absl::string_view src)
|
|
1248
1226
|
|
1249
1227
|
template <typename T>
|
1250
1228
|
constexpr Cord::Cord(strings_internal::StringConstant<T>)
|
1251
|
-
: contents_(strings_internal::StringConstant<T>::value
|
1229
|
+
: contents_(strings_internal::StringConstant<T>::value,
|
1230
|
+
strings_internal::StringConstant<T>::value.size() <=
|
1252
1231
|
cord_internal::kMaxInline
|
1253
|
-
?
|
1254
|
-
|
1255
|
-
|
1256
|
-
&cord_internal::ConstInitExternalStorage<
|
1257
|
-
strings_internal::StringConstant<T>>::value)) {}
|
1232
|
+
? nullptr
|
1233
|
+
: &cord_internal::ConstInitExternalStorage<
|
1234
|
+
strings_internal::StringConstant<T>>::value) {}
|
1258
1235
|
|
1259
1236
|
inline Cord& Cord::operator=(const Cord& x) {
|
1260
1237
|
contents_ = x.contents_;
|
@@ -1290,7 +1267,7 @@ inline size_t Cord::size() const {
|
|
1290
1267
|
return contents_.size();
|
1291
1268
|
}
|
1292
1269
|
|
1293
|
-
inline bool Cord::empty() const { return
|
1270
|
+
inline bool Cord::empty() const { return size() == 0; }
|
1294
1271
|
|
1295
1272
|
inline size_t Cord::EstimatedMemoryUsage(
|
1296
1273
|
CordMemoryAccounting accounting_method) const {
|
@@ -1360,7 +1337,17 @@ inline void Cord::Prepend(CordBuffer buffer) {
|
|
1360
1337
|
|
1361
1338
|
inline CordBuffer Cord::GetAppendBuffer(size_t capacity, size_t min_capacity) {
|
1362
1339
|
if (empty()) return CordBuffer::CreateWithDefaultLimit(capacity);
|
1363
|
-
return GetAppendBufferSlowPath(capacity, min_capacity);
|
1340
|
+
return GetAppendBufferSlowPath(0, capacity, min_capacity);
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
inline CordBuffer Cord::GetCustomAppendBuffer(size_t block_size,
|
1344
|
+
size_t capacity,
|
1345
|
+
size_t min_capacity) {
|
1346
|
+
if (empty()) {
|
1347
|
+
return block_size ? CordBuffer::CreateWithCustomLimit(block_size, capacity)
|
1348
|
+
: CordBuffer::CreateWithDefaultLimit(capacity);
|
1349
|
+
}
|
1350
|
+
return GetAppendBufferSlowPath(block_size, capacity, min_capacity);
|
1364
1351
|
}
|
1365
1352
|
|
1366
1353
|
extern template void Cord::Append(std::string&& src);
|
@@ -1368,7 +1355,7 @@ extern template void Cord::Prepend(std::string&& src);
|
|
1368
1355
|
|
1369
1356
|
inline int Cord::Compare(const Cord& rhs) const {
|
1370
1357
|
if (!contents_.is_tree() && !rhs.contents_.is_tree()) {
|
1371
|
-
return contents_.
|
1358
|
+
return contents_.data_.Compare(rhs.contents_.data_);
|
1372
1359
|
}
|
1373
1360
|
|
1374
1361
|
return CompareImpl(rhs);
|
@@ -1406,7 +1393,11 @@ inline Cord::ChunkIterator::ChunkIterator(cord_internal::CordRep* tree) {
|
|
1406
1393
|
inline Cord::ChunkIterator::ChunkIterator(const Cord* cord) {
|
1407
1394
|
if (CordRep* tree = cord->contents_.tree()) {
|
1408
1395
|
bytes_remaining_ = tree->length;
|
1409
|
-
|
1396
|
+
if (ABSL_PREDICT_TRUE(bytes_remaining_ != 0)) {
|
1397
|
+
InitTree(tree);
|
1398
|
+
} else {
|
1399
|
+
current_chunk_ = {};
|
1400
|
+
}
|
1410
1401
|
} else {
|
1411
1402
|
bytes_remaining_ = cord->contents_.inline_size();
|
1412
1403
|
current_chunk_ = {cord->contents_.data(), bytes_remaining_};
|
@@ -1575,7 +1566,7 @@ inline void Cord::ForEachChunk(
|
|
1575
1566
|
if (rep == nullptr) {
|
1576
1567
|
callback(absl::string_view(contents_.data(), contents_.size()));
|
1577
1568
|
} else {
|
1578
|
-
|
1569
|
+
ForEachChunkAux(rep, callback);
|
1579
1570
|
}
|
1580
1571
|
}
|
1581
1572
|
|
@@ -330,8 +330,7 @@ class CordBuffer {
|
|
330
330
|
|
331
331
|
// Returns the available area of the internal SSO data
|
332
332
|
absl::Span<char> short_available() {
|
333
|
-
|
334
|
-
const size_t length = (short_rep.raw_size >> 1);
|
333
|
+
const size_t length = short_length();
|
335
334
|
return absl::Span<char>(short_rep.data + length,
|
336
335
|
kInlineCapacity - length);
|
337
336
|
}
|
@@ -347,7 +346,7 @@ class CordBuffer {
|
|
347
346
|
// Returns the length of the internal SSO data.
|
348
347
|
size_t short_length() const {
|
349
348
|
assert(is_short());
|
350
|
-
return short_rep.raw_size >> 1;
|
349
|
+
return static_cast<size_t>(short_rep.raw_size >> 1);
|
351
350
|
}
|
352
351
|
|
353
352
|
// Sets the length of the internal SSO data.
|
@@ -412,8 +411,12 @@ class CordBuffer {
|
|
412
411
|
|
413
412
|
// Power2 functions
|
414
413
|
static bool IsPow2(size_t size) { return absl::has_single_bit(size); }
|
415
|
-
static size_t Log2Floor(size_t size) {
|
416
|
-
|
414
|
+
static size_t Log2Floor(size_t size) {
|
415
|
+
return static_cast<size_t>(absl::bit_width(size) - 1);
|
416
|
+
}
|
417
|
+
static size_t Log2Ceil(size_t size) {
|
418
|
+
return static_cast<size_t>(absl::bit_width(size - 1));
|
419
|
+
}
|
417
420
|
|
418
421
|
// Implementation of `CreateWithCustomLimit()`.
|
419
422
|
// This implementation allows for future memory allocation hints to
|