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
@@ -78,6 +78,7 @@ struct timeval;
|
|
78
78
|
#include <cmath>
|
79
79
|
#include <cstdint>
|
80
80
|
#include <ctime>
|
81
|
+
#include <limits>
|
81
82
|
#include <ostream>
|
82
83
|
#include <string>
|
83
84
|
#include <type_traits>
|
@@ -97,19 +98,24 @@ class TimeZone; // Defined below
|
|
97
98
|
|
98
99
|
namespace time_internal {
|
99
100
|
int64_t IDivDuration(bool satq, Duration num, Duration den, Duration* rem);
|
100
|
-
constexpr Time FromUnixDuration(Duration d);
|
101
|
-
constexpr Duration ToUnixDuration(Time t);
|
102
|
-
constexpr int64_t GetRepHi(Duration d);
|
103
|
-
constexpr uint32_t GetRepLo(Duration d);
|
104
|
-
constexpr Duration MakeDuration(int64_t hi,
|
105
|
-
|
106
|
-
|
101
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixDuration(Duration d);
|
102
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration ToUnixDuration(Time t);
|
103
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t GetRepHi(Duration d);
|
104
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr uint32_t GetRepLo(Duration d);
|
105
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeDuration(int64_t hi,
|
106
|
+
uint32_t lo);
|
107
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeDuration(int64_t hi,
|
108
|
+
int64_t lo);
|
109
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration MakePosDoubleDuration(double n);
|
107
110
|
constexpr int64_t kTicksPerNanosecond = 4;
|
108
111
|
constexpr int64_t kTicksPerSecond = 1000 * 1000 * 1000 * kTicksPerNanosecond;
|
109
112
|
template <std::intmax_t N>
|
110
|
-
constexpr Duration FromInt64(int64_t v,
|
111
|
-
|
112
|
-
constexpr Duration FromInt64(int64_t v,
|
113
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
114
|
+
std::ratio<1, N>);
|
115
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
116
|
+
std::ratio<60>);
|
117
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
118
|
+
std::ratio<3600>);
|
113
119
|
template <typename T>
|
114
120
|
using EnableIfIntegral = typename std::enable_if<
|
115
121
|
std::is_integral<T>::value || std::is_enum<T>::value, int>::type;
|
@@ -222,37 +228,61 @@ class Duration {
|
|
222
228
|
};
|
223
229
|
|
224
230
|
// Relational Operators
|
225
|
-
constexpr bool operator<(Duration lhs,
|
226
|
-
|
227
|
-
constexpr bool operator
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator<(Duration lhs,
|
232
|
+
Duration rhs);
|
233
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator>(Duration lhs,
|
234
|
+
Duration rhs) {
|
235
|
+
return rhs < lhs;
|
236
|
+
}
|
237
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator>=(Duration lhs,
|
238
|
+
Duration rhs) {
|
239
|
+
return !(lhs < rhs);
|
240
|
+
}
|
241
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator<=(Duration lhs,
|
242
|
+
Duration rhs) {
|
243
|
+
return !(rhs < lhs);
|
244
|
+
}
|
245
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator==(Duration lhs,
|
246
|
+
Duration rhs);
|
247
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator!=(Duration lhs,
|
248
|
+
Duration rhs) {
|
249
|
+
return !(lhs == rhs);
|
250
|
+
}
|
231
251
|
|
232
252
|
// Additive Operators
|
233
|
-
constexpr Duration operator-(Duration d);
|
234
|
-
inline Duration operator+(Duration lhs,
|
235
|
-
|
253
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration operator-(Duration d);
|
254
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration operator+(Duration lhs,
|
255
|
+
Duration rhs) {
|
256
|
+
return lhs += rhs;
|
257
|
+
}
|
258
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration operator-(Duration lhs,
|
259
|
+
Duration rhs) {
|
260
|
+
return lhs -= rhs;
|
261
|
+
}
|
236
262
|
|
237
263
|
// Multiplicative Operators
|
238
264
|
// Integer operands must be representable as int64_t.
|
239
265
|
template <typename T>
|
240
|
-
Duration operator*(Duration lhs, T rhs) {
|
266
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration operator*(Duration lhs, T rhs) {
|
241
267
|
return lhs *= rhs;
|
242
268
|
}
|
243
269
|
template <typename T>
|
244
|
-
Duration operator*(T lhs, Duration rhs) {
|
270
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration operator*(T lhs, Duration rhs) {
|
245
271
|
return rhs *= lhs;
|
246
272
|
}
|
247
273
|
template <typename T>
|
248
|
-
Duration operator/(Duration lhs, T rhs) {
|
274
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration operator/(Duration lhs, T rhs) {
|
249
275
|
return lhs /= rhs;
|
250
276
|
}
|
251
|
-
inline int64_t operator/(Duration lhs,
|
277
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t operator/(Duration lhs,
|
278
|
+
Duration rhs) {
|
252
279
|
return time_internal::IDivDuration(true, lhs, rhs,
|
253
280
|
&lhs); // trunc towards zero
|
254
281
|
}
|
255
|
-
inline Duration operator%(Duration lhs,
|
282
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration operator%(Duration lhs,
|
283
|
+
Duration rhs) {
|
284
|
+
return lhs %= rhs;
|
285
|
+
}
|
256
286
|
|
257
287
|
// IDivDuration()
|
258
288
|
//
|
@@ -299,18 +329,20 @@ inline int64_t IDivDuration(Duration num, Duration den, Duration* rem) {
|
|
299
329
|
//
|
300
330
|
// double d = absl::FDivDuration(absl::Milliseconds(1500), absl::Seconds(1));
|
301
331
|
// // d == 1.5
|
302
|
-
double FDivDuration(Duration num, Duration den);
|
332
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double FDivDuration(Duration num, Duration den);
|
303
333
|
|
304
334
|
// ZeroDuration()
|
305
335
|
//
|
306
336
|
// Returns a zero-length duration. This function behaves just like the default
|
307
337
|
// constructor, but the name helps make the semantics clear at call sites.
|
308
|
-
constexpr Duration ZeroDuration() {
|
338
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration ZeroDuration() {
|
339
|
+
return Duration();
|
340
|
+
}
|
309
341
|
|
310
342
|
// AbsDuration()
|
311
343
|
//
|
312
344
|
// Returns the absolute value of a duration.
|
313
|
-
inline Duration AbsDuration(Duration d) {
|
345
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration AbsDuration(Duration d) {
|
314
346
|
return (d < ZeroDuration()) ? -d : d;
|
315
347
|
}
|
316
348
|
|
@@ -322,7 +354,7 @@ inline Duration AbsDuration(Duration d) {
|
|
322
354
|
//
|
323
355
|
// absl::Duration d = absl::Nanoseconds(123456789);
|
324
356
|
// absl::Duration a = absl::Trunc(d, absl::Microseconds(1)); // 123456us
|
325
|
-
Duration Trunc(Duration d, Duration unit);
|
357
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Trunc(Duration d, Duration unit);
|
326
358
|
|
327
359
|
// Floor()
|
328
360
|
//
|
@@ -333,7 +365,7 @@ Duration Trunc(Duration d, Duration unit);
|
|
333
365
|
//
|
334
366
|
// absl::Duration d = absl::Nanoseconds(123456789);
|
335
367
|
// absl::Duration b = absl::Floor(d, absl::Microseconds(1)); // 123456us
|
336
|
-
Duration Floor(Duration d, Duration unit);
|
368
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Floor(Duration d, Duration unit);
|
337
369
|
|
338
370
|
// Ceil()
|
339
371
|
//
|
@@ -344,7 +376,7 @@ Duration Floor(Duration d, Duration unit);
|
|
344
376
|
//
|
345
377
|
// absl::Duration d = absl::Nanoseconds(123456789);
|
346
378
|
// absl::Duration c = absl::Ceil(d, absl::Microseconds(1)); // 123457us
|
347
|
-
Duration Ceil(Duration d, Duration unit);
|
379
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Ceil(Duration d, Duration unit);
|
348
380
|
|
349
381
|
// InfiniteDuration()
|
350
382
|
//
|
@@ -380,7 +412,7 @@ Duration Ceil(Duration d, Duration unit);
|
|
380
412
|
//
|
381
413
|
// The examples involving the `/` operator above also apply to `IDivDuration()`
|
382
414
|
// and `FDivDuration()`.
|
383
|
-
constexpr Duration InfiniteDuration();
|
415
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration InfiniteDuration();
|
384
416
|
|
385
417
|
// Nanoseconds()
|
386
418
|
// Microseconds()
|
@@ -404,27 +436,27 @@ constexpr Duration InfiniteDuration();
|
|
404
436
|
// absl::Duration a = absl::Seconds(60);
|
405
437
|
// absl::Duration b = absl::Minutes(1); // b == a
|
406
438
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
407
|
-
constexpr Duration Nanoseconds(T n) {
|
439
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Nanoseconds(T n) {
|
408
440
|
return time_internal::FromInt64(n, std::nano{});
|
409
441
|
}
|
410
442
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
411
|
-
constexpr Duration Microseconds(T n) {
|
443
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Microseconds(T n) {
|
412
444
|
return time_internal::FromInt64(n, std::micro{});
|
413
445
|
}
|
414
446
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
415
|
-
constexpr Duration Milliseconds(T n) {
|
447
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Milliseconds(T n) {
|
416
448
|
return time_internal::FromInt64(n, std::milli{});
|
417
449
|
}
|
418
450
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
419
|
-
constexpr Duration Seconds(T n) {
|
451
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Seconds(T n) {
|
420
452
|
return time_internal::FromInt64(n, std::ratio<1>{});
|
421
453
|
}
|
422
454
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
423
|
-
constexpr Duration Minutes(T n) {
|
455
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Minutes(T n) {
|
424
456
|
return time_internal::FromInt64(n, std::ratio<60>{});
|
425
457
|
}
|
426
458
|
template <typename T, time_internal::EnableIfIntegral<T> = 0>
|
427
|
-
constexpr Duration Hours(T n) {
|
459
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration Hours(T n) {
|
428
460
|
return time_internal::FromInt64(n, std::ratio<3600>{});
|
429
461
|
}
|
430
462
|
|
@@ -438,19 +470,19 @@ constexpr Duration Hours(T n) {
|
|
438
470
|
// auto a = absl::Seconds(1.5); // OK
|
439
471
|
// auto b = absl::Milliseconds(1500); // BETTER
|
440
472
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
441
|
-
Duration Nanoseconds(T n) {
|
473
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Nanoseconds(T n) {
|
442
474
|
return n * Nanoseconds(1);
|
443
475
|
}
|
444
476
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
445
|
-
Duration Microseconds(T n) {
|
477
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Microseconds(T n) {
|
446
478
|
return n * Microseconds(1);
|
447
479
|
}
|
448
480
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
449
|
-
Duration Milliseconds(T n) {
|
481
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Milliseconds(T n) {
|
450
482
|
return n * Milliseconds(1);
|
451
483
|
}
|
452
484
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
453
|
-
Duration Seconds(T n) {
|
485
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Seconds(T n) {
|
454
486
|
if (n >= 0) { // Note: `NaN >= 0` is false.
|
455
487
|
if (n >= static_cast<T>((std::numeric_limits<int64_t>::max)())) {
|
456
488
|
return InfiniteDuration();
|
@@ -464,11 +496,11 @@ Duration Seconds(T n) {
|
|
464
496
|
}
|
465
497
|
}
|
466
498
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
467
|
-
Duration Minutes(T n) {
|
499
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Minutes(T n) {
|
468
500
|
return n * Minutes(1);
|
469
501
|
}
|
470
502
|
template <typename T, time_internal::EnableIfFloat<T> = 0>
|
471
|
-
Duration Hours(T n) {
|
503
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration Hours(T n) {
|
472
504
|
return n * Hours(1);
|
473
505
|
}
|
474
506
|
|
@@ -488,14 +520,14 @@ Duration Hours(T n) {
|
|
488
520
|
//
|
489
521
|
// absl::Duration d = absl::Milliseconds(1500);
|
490
522
|
// int64_t isec = absl::ToInt64Seconds(d); // isec == 1
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
//
|
523
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Nanoseconds(Duration d);
|
524
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Microseconds(Duration d);
|
525
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Milliseconds(Duration d);
|
526
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Seconds(Duration d);
|
527
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Minutes(Duration d);
|
528
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64Hours(Duration d);
|
529
|
+
|
530
|
+
// ToDoubleNanoseconds()
|
499
531
|
// ToDoubleMicroseconds()
|
500
532
|
// ToDoubleMilliseconds()
|
501
533
|
// ToDoubleSeconds()
|
@@ -510,12 +542,12 @@ ABSL_ATTRIBUTE_PURE_FUNCTION int64_t ToInt64Hours(Duration d);
|
|
510
542
|
//
|
511
543
|
// absl::Duration d = absl::Milliseconds(1500);
|
512
544
|
// double dsec = absl::ToDoubleSeconds(d); // dsec == 1.5
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
545
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleNanoseconds(Duration d);
|
546
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleMicroseconds(Duration d);
|
547
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleMilliseconds(Duration d);
|
548
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleSeconds(Duration d);
|
549
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleMinutes(Duration d);
|
550
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToDoubleHours(Duration d);
|
519
551
|
|
520
552
|
// FromChrono()
|
521
553
|
//
|
@@ -525,12 +557,18 @@ ABSL_ATTRIBUTE_PURE_FUNCTION double ToDoubleHours(Duration d);
|
|
525
557
|
//
|
526
558
|
// std::chrono::milliseconds ms(123);
|
527
559
|
// absl::Duration d = absl::FromChrono(ms);
|
528
|
-
constexpr Duration FromChrono(
|
529
|
-
|
530
|
-
constexpr Duration FromChrono(
|
531
|
-
|
532
|
-
constexpr Duration FromChrono(
|
533
|
-
|
560
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
561
|
+
const std::chrono::nanoseconds& d);
|
562
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
563
|
+
const std::chrono::microseconds& d);
|
564
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
565
|
+
const std::chrono::milliseconds& d);
|
566
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
567
|
+
const std::chrono::seconds& d);
|
568
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
569
|
+
const std::chrono::minutes& d);
|
570
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
571
|
+
const std::chrono::hours& d);
|
534
572
|
|
535
573
|
// ToChronoNanoseconds()
|
536
574
|
// ToChronoMicroseconds()
|
@@ -550,18 +588,21 @@ constexpr Duration FromChrono(const std::chrono::hours& d);
|
|
550
588
|
// auto y = absl::ToChronoNanoseconds(d); // x == y
|
551
589
|
// auto z = absl::ToChronoSeconds(absl::InfiniteDuration());
|
552
590
|
// // z == std::chrono::seconds::max()
|
553
|
-
std::chrono::nanoseconds ToChronoNanoseconds(
|
554
|
-
|
555
|
-
std::chrono::
|
556
|
-
|
557
|
-
std::chrono::
|
558
|
-
|
591
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::nanoseconds ToChronoNanoseconds(
|
592
|
+
Duration d);
|
593
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::microseconds ToChronoMicroseconds(
|
594
|
+
Duration d);
|
595
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::milliseconds ToChronoMilliseconds(
|
596
|
+
Duration d);
|
597
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::seconds ToChronoSeconds(Duration d);
|
598
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::minutes ToChronoMinutes(Duration d);
|
599
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::hours ToChronoHours(Duration d);
|
559
600
|
|
560
601
|
// FormatDuration()
|
561
602
|
//
|
562
603
|
// Returns a string representing the duration in the form "72h3m0.5s".
|
563
604
|
// Returns "inf" or "-inf" for +/- `InfiniteDuration()`.
|
564
|
-
std::string FormatDuration(Duration d);
|
605
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::string FormatDuration(Duration d);
|
565
606
|
|
566
607
|
// Output stream operator.
|
567
608
|
inline std::ostream& operator<<(std::ostream& os, Duration d) {
|
@@ -725,29 +766,49 @@ class Time {
|
|
725
766
|
};
|
726
767
|
|
727
768
|
// Relational Operators
|
728
|
-
constexpr bool operator<(Time lhs, Time rhs) {
|
729
|
-
|
730
|
-
|
731
|
-
constexpr bool operator
|
732
|
-
|
733
|
-
|
769
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator<(Time lhs, Time rhs) {
|
770
|
+
return lhs.rep_ < rhs.rep_;
|
771
|
+
}
|
772
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator>(Time lhs, Time rhs) {
|
773
|
+
return rhs < lhs;
|
774
|
+
}
|
775
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator>=(Time lhs, Time rhs) {
|
776
|
+
return !(lhs < rhs);
|
777
|
+
}
|
778
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator<=(Time lhs, Time rhs) {
|
779
|
+
return !(rhs < lhs);
|
780
|
+
}
|
781
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator==(Time lhs, Time rhs) {
|
782
|
+
return lhs.rep_ == rhs.rep_;
|
783
|
+
}
|
784
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator!=(Time lhs, Time rhs) {
|
785
|
+
return !(lhs == rhs);
|
786
|
+
}
|
734
787
|
|
735
788
|
// Additive Operators
|
736
|
-
inline Time operator+(Time lhs, Duration rhs) {
|
737
|
-
|
738
|
-
|
739
|
-
inline
|
789
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Time operator+(Time lhs, Duration rhs) {
|
790
|
+
return lhs += rhs;
|
791
|
+
}
|
792
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Time operator+(Duration lhs, Time rhs) {
|
793
|
+
return rhs += lhs;
|
794
|
+
}
|
795
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Time operator-(Time lhs, Duration rhs) {
|
796
|
+
return lhs -= rhs;
|
797
|
+
}
|
798
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration operator-(Time lhs, Time rhs) {
|
799
|
+
return lhs.rep_ - rhs.rep_;
|
800
|
+
}
|
740
801
|
|
741
802
|
// UnixEpoch()
|
742
803
|
//
|
743
804
|
// Returns the `absl::Time` representing "1970-01-01 00:00:00.0 +0000".
|
744
|
-
constexpr Time UnixEpoch() { return Time(); }
|
805
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time UnixEpoch() { return Time(); }
|
745
806
|
|
746
807
|
// UniversalEpoch()
|
747
808
|
//
|
748
809
|
// Returns the `absl::Time` representing "0001-01-01 00:00:00.0 +0000", the
|
749
810
|
// epoch of the ICU Universal Time Scale.
|
750
|
-
constexpr Time UniversalEpoch() {
|
811
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time UniversalEpoch() {
|
751
812
|
// 719162 is the number of days from 0001-01-01 to 1970-01-01,
|
752
813
|
// assuming the Gregorian calendar.
|
753
814
|
return Time(
|
@@ -757,7 +818,7 @@ constexpr Time UniversalEpoch() {
|
|
757
818
|
// InfiniteFuture()
|
758
819
|
//
|
759
820
|
// Returns an `absl::Time` that is infinitely far in the future.
|
760
|
-
constexpr Time InfiniteFuture() {
|
821
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time InfiniteFuture() {
|
761
822
|
return Time(time_internal::MakeDuration((std::numeric_limits<int64_t>::max)(),
|
762
823
|
~uint32_t{0}));
|
763
824
|
}
|
@@ -765,7 +826,7 @@ constexpr Time InfiniteFuture() {
|
|
765
826
|
// InfinitePast()
|
766
827
|
//
|
767
828
|
// Returns an `absl::Time` that is infinitely far in the past.
|
768
|
-
constexpr Time InfinitePast() {
|
829
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time InfinitePast() {
|
769
830
|
return Time(time_internal::MakeDuration((std::numeric_limits<int64_t>::min)(),
|
770
831
|
~uint32_t{0}));
|
771
832
|
}
|
@@ -779,13 +840,13 @@ constexpr Time InfinitePast() {
|
|
779
840
|
// FromUniversal()
|
780
841
|
//
|
781
842
|
// Creates an `absl::Time` from a variety of other representations.
|
782
|
-
constexpr Time FromUnixNanos(int64_t ns);
|
783
|
-
constexpr Time FromUnixMicros(int64_t us);
|
784
|
-
constexpr Time FromUnixMillis(int64_t ms);
|
785
|
-
constexpr Time FromUnixSeconds(int64_t s);
|
786
|
-
constexpr Time FromTimeT(time_t t);
|
787
|
-
Time FromUDate(double udate);
|
788
|
-
Time FromUniversal(int64_t universal);
|
843
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixNanos(int64_t ns);
|
844
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMicros(int64_t us);
|
845
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMillis(int64_t ms);
|
846
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixSeconds(int64_t s);
|
847
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromTimeT(time_t t);
|
848
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Time FromUDate(double udate);
|
849
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Time FromUniversal(int64_t universal);
|
789
850
|
|
790
851
|
// ToUnixNanos()
|
791
852
|
// ToUnixMicros()
|
@@ -799,13 +860,13 @@ Time FromUniversal(int64_t universal);
|
|
799
860
|
// these operations round down toward negative infinity where necessary to
|
800
861
|
// adjust to the resolution of the result type. Beware of possible time_t
|
801
862
|
// over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
|
802
|
-
int64_t ToUnixNanos(Time t);
|
803
|
-
int64_t ToUnixMicros(Time t);
|
804
|
-
int64_t ToUnixMillis(Time t);
|
805
|
-
int64_t ToUnixSeconds(Time t);
|
806
|
-
time_t ToTimeT(Time t);
|
807
|
-
double ToUDate(Time t);
|
808
|
-
int64_t ToUniversal(Time t);
|
863
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixNanos(Time t);
|
864
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMicros(Time t);
|
865
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMillis(Time t);
|
866
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixSeconds(Time t);
|
867
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION time_t ToTimeT(Time t);
|
868
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION double ToUDate(Time t);
|
869
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUniversal(Time t);
|
809
870
|
|
810
871
|
// DurationFromTimespec()
|
811
872
|
// DurationFromTimeval()
|
@@ -821,14 +882,14 @@ int64_t ToUniversal(Time t);
|
|
821
882
|
// and gettimeofday(2)), so conversion functions are provided for both cases.
|
822
883
|
// The "to timespec/val" direction is easily handled via overloading, but
|
823
884
|
// for "from timespec/val" the desired type is part of the function name.
|
824
|
-
Duration DurationFromTimespec(timespec ts);
|
825
|
-
Duration DurationFromTimeval(timeval tv);
|
826
|
-
timespec ToTimespec(Duration d);
|
827
|
-
timeval ToTimeval(Duration d);
|
828
|
-
Time TimeFromTimespec(timespec ts);
|
829
|
-
Time TimeFromTimeval(timeval tv);
|
830
|
-
timespec ToTimespec(Time t);
|
831
|
-
timeval ToTimeval(Time t);
|
885
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration DurationFromTimespec(timespec ts);
|
886
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Duration DurationFromTimeval(timeval tv);
|
887
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION timespec ToTimespec(Duration d);
|
888
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION timeval ToTimeval(Duration d);
|
889
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Time TimeFromTimespec(timespec ts);
|
890
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION Time TimeFromTimeval(timeval tv);
|
891
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION timespec ToTimespec(Time t);
|
892
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION timeval ToTimeval(Time t);
|
832
893
|
|
833
894
|
// FromChrono()
|
834
895
|
//
|
@@ -839,7 +900,8 @@ timeval ToTimeval(Time t);
|
|
839
900
|
// auto tp = std::chrono::system_clock::from_time_t(123);
|
840
901
|
// absl::Time t = absl::FromChrono(tp);
|
841
902
|
// // t == absl::FromTimeT(123)
|
842
|
-
Time
|
903
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION Time
|
904
|
+
FromChrono(const std::chrono::system_clock::time_point& tp);
|
843
905
|
|
844
906
|
// ToChronoTime()
|
845
907
|
//
|
@@ -852,7 +914,8 @@ Time FromChrono(const std::chrono::system_clock::time_point& tp);
|
|
852
914
|
// absl::Time t = absl::FromTimeT(123);
|
853
915
|
// auto tp = absl::ToChronoTime(t);
|
854
916
|
// // tp == std::chrono::system_clock::from_time_t(123);
|
855
|
-
std::chrono::system_clock::time_point
|
917
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION std::chrono::system_clock::time_point
|
918
|
+
ToChronoTime(Time);
|
856
919
|
|
857
920
|
// AbslParseFlag()
|
858
921
|
//
|
@@ -1124,22 +1187,25 @@ inline TimeZone LocalTimeZone() {
|
|
1124
1187
|
// absl::Time t = ...;
|
1125
1188
|
// absl::TimeZone tz = ...;
|
1126
1189
|
// const auto cd = absl::ToCivilDay(t, tz);
|
1127
|
-
inline CivilSecond ToCivilSecond(Time t,
|
1190
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilSecond ToCivilSecond(Time t,
|
1191
|
+
TimeZone tz) {
|
1128
1192
|
return tz.At(t).cs; // already a CivilSecond
|
1129
1193
|
}
|
1130
|
-
inline CivilMinute ToCivilMinute(Time t,
|
1194
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilMinute ToCivilMinute(Time t,
|
1195
|
+
TimeZone tz) {
|
1131
1196
|
return CivilMinute(tz.At(t).cs);
|
1132
1197
|
}
|
1133
|
-
inline CivilHour ToCivilHour(Time t, TimeZone tz) {
|
1198
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilHour ToCivilHour(Time t, TimeZone tz) {
|
1134
1199
|
return CivilHour(tz.At(t).cs);
|
1135
1200
|
}
|
1136
|
-
inline CivilDay ToCivilDay(Time t, TimeZone tz) {
|
1201
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilDay ToCivilDay(Time t, TimeZone tz) {
|
1137
1202
|
return CivilDay(tz.At(t).cs);
|
1138
1203
|
}
|
1139
|
-
inline CivilMonth ToCivilMonth(Time t,
|
1204
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilMonth ToCivilMonth(Time t,
|
1205
|
+
TimeZone tz) {
|
1140
1206
|
return CivilMonth(tz.At(t).cs);
|
1141
1207
|
}
|
1142
|
-
inline CivilYear ToCivilYear(Time t, TimeZone tz) {
|
1208
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline CivilYear ToCivilYear(Time t, TimeZone tz) {
|
1143
1209
|
return CivilYear(tz.At(t).cs);
|
1144
1210
|
}
|
1145
1211
|
|
@@ -1155,7 +1221,8 @@ inline CivilYear ToCivilYear(Time t, TimeZone tz) {
|
|
1155
1221
|
// being when two non-existent civil times map to the same transition time.
|
1156
1222
|
//
|
1157
1223
|
// Note: Accepts civil times of any alignment.
|
1158
|
-
inline Time FromCivil(CivilSecond ct,
|
1224
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION inline Time FromCivil(CivilSecond ct,
|
1225
|
+
TimeZone tz) {
|
1159
1226
|
const auto ti = tz.At(ct);
|
1160
1227
|
if (ti.kind == TimeZone::TimeInfo::SKIPPED) return ti.trans;
|
1161
1228
|
return ti.pre;
|
@@ -1240,13 +1307,13 @@ inline Time FromDateTime(int64_t year, int mon, int day, int hour,
|
|
1240
1307
|
// instant, so `tm_isdst != 0` returns the DST instant, and `tm_isdst == 0`
|
1241
1308
|
// returns the non-DST instant, that would have matched if the transition never
|
1242
1309
|
// happened.
|
1243
|
-
Time FromTM(const struct tm& tm, TimeZone tz);
|
1310
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION Time FromTM(const struct tm& tm, TimeZone tz);
|
1244
1311
|
|
1245
1312
|
// ToTM()
|
1246
1313
|
//
|
1247
1314
|
// Converts the given `absl::Time` to a struct tm using the given time zone.
|
1248
1315
|
// See ctime(3) for a description of the values of the tm fields.
|
1249
|
-
struct tm ToTM(Time t, TimeZone tz);
|
1316
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION struct tm ToTM(Time t, TimeZone tz);
|
1250
1317
|
|
1251
1318
|
// RFC3339_full
|
1252
1319
|
// RFC3339_sec
|
@@ -1305,13 +1372,14 @@ ABSL_DLL extern const char RFC1123_no_wday[]; // %d %b %E4Y %H:%M:%S %z
|
|
1305
1372
|
// `absl::InfinitePast()`, the returned string will be exactly "infinite-past".
|
1306
1373
|
// In both cases the given format string and `absl::TimeZone` are ignored.
|
1307
1374
|
//
|
1308
|
-
std::string FormatTime(absl::string_view format,
|
1375
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(absl::string_view format,
|
1376
|
+
Time t, TimeZone tz);
|
1309
1377
|
|
1310
1378
|
// Convenience functions that format the given time using the RFC3339_full
|
1311
1379
|
// format. The first overload uses the provided TimeZone, while the second
|
1312
1380
|
// uses LocalTimeZone().
|
1313
|
-
std::string FormatTime(Time t, TimeZone tz);
|
1314
|
-
std::string FormatTime(Time t);
|
1381
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(Time t, TimeZone tz);
|
1382
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(Time t);
|
1315
1383
|
|
1316
1384
|
// Output stream operator.
|
1317
1385
|
inline std::ostream& operator<<(std::ostream& os, Time t) {
|
@@ -1389,18 +1457,20 @@ namespace time_internal {
|
|
1389
1457
|
// Creates a Duration with a given representation.
|
1390
1458
|
// REQUIRES: hi,lo is a valid representation of a Duration as specified
|
1391
1459
|
// in time/duration.cc.
|
1392
|
-
constexpr Duration MakeDuration(int64_t hi,
|
1460
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeDuration(int64_t hi,
|
1461
|
+
uint32_t lo = 0) {
|
1393
1462
|
return Duration(hi, lo);
|
1394
1463
|
}
|
1395
1464
|
|
1396
|
-
constexpr Duration MakeDuration(int64_t hi,
|
1465
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeDuration(int64_t hi,
|
1466
|
+
int64_t lo) {
|
1397
1467
|
return MakeDuration(hi, static_cast<uint32_t>(lo));
|
1398
1468
|
}
|
1399
1469
|
|
1400
1470
|
// Make a Duration value from a floating-point number, as long as that number
|
1401
1471
|
// is in the range [ 0 .. numeric_limits<int64_t>::max ), that is, as long as
|
1402
1472
|
// it's positive and can be converted to int64_t without risk of UB.
|
1403
|
-
inline Duration MakePosDoubleDuration(double n) {
|
1473
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline Duration MakePosDoubleDuration(double n) {
|
1404
1474
|
const int64_t int_secs = static_cast<int64_t>(n);
|
1405
1475
|
const uint32_t ticks = static_cast<uint32_t>(
|
1406
1476
|
std::round((n - static_cast<double>(int_secs)) * kTicksPerSecond));
|
@@ -1413,23 +1483,28 @@ inline Duration MakePosDoubleDuration(double n) {
|
|
1413
1483
|
// pair. sec may be positive or negative. ticks must be in the range
|
1414
1484
|
// -kTicksPerSecond < *ticks < kTicksPerSecond. If ticks is negative it
|
1415
1485
|
// will be normalized to a positive value in the resulting Duration.
|
1416
|
-
constexpr Duration MakeNormalizedDuration(
|
1486
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeNormalizedDuration(
|
1487
|
+
int64_t sec, int64_t ticks) {
|
1417
1488
|
return (ticks < 0) ? MakeDuration(sec - 1, ticks + kTicksPerSecond)
|
1418
1489
|
: MakeDuration(sec, ticks);
|
1419
1490
|
}
|
1420
1491
|
|
1421
1492
|
// Provide access to the Duration representation.
|
1422
|
-
constexpr int64_t GetRepHi(Duration d) {
|
1423
|
-
|
1493
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t GetRepHi(Duration d) {
|
1494
|
+
return d.rep_hi_;
|
1495
|
+
}
|
1496
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr uint32_t GetRepLo(Duration d) {
|
1497
|
+
return d.rep_lo_;
|
1498
|
+
}
|
1424
1499
|
|
1425
1500
|
// Returns true iff d is positive or negative infinity.
|
1426
|
-
constexpr bool IsInfiniteDuration(Duration d) {
|
1501
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool IsInfiniteDuration(Duration d) {
|
1427
1502
|
return GetRepLo(d) == ~uint32_t{0};
|
1428
1503
|
}
|
1429
1504
|
|
1430
1505
|
// Returns an infinite Duration with the opposite sign.
|
1431
1506
|
// REQUIRES: IsInfiniteDuration(d)
|
1432
|
-
constexpr Duration OppositeInfinity(Duration d) {
|
1507
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration OppositeInfinity(Duration d) {
|
1433
1508
|
return GetRepHi(d) < 0
|
1434
1509
|
? MakeDuration((std::numeric_limits<int64_t>::max)(), ~uint32_t{0})
|
1435
1510
|
: MakeDuration((std::numeric_limits<int64_t>::min)(),
|
@@ -1437,7 +1512,8 @@ constexpr Duration OppositeInfinity(Duration d) {
|
|
1437
1512
|
}
|
1438
1513
|
|
1439
1514
|
// Returns (-n)-1 (equivalently -(n+1)) without avoidable overflow.
|
1440
|
-
constexpr int64_t NegateAndSubtractOne(
|
1515
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t NegateAndSubtractOne(
|
1516
|
+
int64_t n) {
|
1441
1517
|
// Note: Good compilers will optimize this expression to ~n when using
|
1442
1518
|
// a two's-complement representation (which is required for int64_t).
|
1443
1519
|
return (n < 0) ? -(n + 1) : (-n) - 1;
|
@@ -1447,23 +1523,30 @@ constexpr int64_t NegateAndSubtractOne(int64_t n) {
|
|
1447
1523
|
// functions depend on the above mentioned choice of the Unix epoch for the
|
1448
1524
|
// Time representation (and both need to be Time friends). Without this
|
1449
1525
|
// knowledge, we would need to add-in/subtract-out UnixEpoch() respectively.
|
1450
|
-
constexpr Time FromUnixDuration(Duration d) {
|
1451
|
-
|
1526
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixDuration(Duration d) {
|
1527
|
+
return Time(d);
|
1528
|
+
}
|
1529
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration ToUnixDuration(Time t) {
|
1530
|
+
return t.rep_;
|
1531
|
+
}
|
1452
1532
|
|
1453
1533
|
template <std::intmax_t N>
|
1454
|
-
constexpr Duration FromInt64(int64_t v,
|
1534
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
1535
|
+
std::ratio<1, N>) {
|
1455
1536
|
static_assert(0 < N && N <= 1000 * 1000 * 1000, "Unsupported ratio");
|
1456
1537
|
// Subsecond ratios cannot overflow.
|
1457
1538
|
return MakeNormalizedDuration(
|
1458
1539
|
v / N, v % N * kTicksPerNanosecond * 1000 * 1000 * 1000 / N);
|
1459
1540
|
}
|
1460
|
-
constexpr Duration FromInt64(int64_t v,
|
1541
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
1542
|
+
std::ratio<60>) {
|
1461
1543
|
return (v <= (std::numeric_limits<int64_t>::max)() / 60 &&
|
1462
1544
|
v >= (std::numeric_limits<int64_t>::min)() / 60)
|
1463
1545
|
? MakeDuration(v * 60)
|
1464
1546
|
: v > 0 ? InfiniteDuration() : -InfiniteDuration();
|
1465
1547
|
}
|
1466
|
-
constexpr Duration FromInt64(int64_t v,
|
1548
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration FromInt64(int64_t v,
|
1549
|
+
std::ratio<3600>) {
|
1467
1550
|
return (v <= (std::numeric_limits<int64_t>::max)() / 3600 &&
|
1468
1551
|
v >= (std::numeric_limits<int64_t>::min)() / 3600)
|
1469
1552
|
? MakeDuration(v * 3600)
|
@@ -1483,40 +1566,44 @@ constexpr auto IsValidRep64(char) -> bool {
|
|
1483
1566
|
|
1484
1567
|
// Converts a std::chrono::duration to an absl::Duration.
|
1485
1568
|
template <typename Rep, typename Period>
|
1486
|
-
constexpr Duration FromChrono(
|
1569
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1570
|
+
const std::chrono::duration<Rep, Period>& d) {
|
1487
1571
|
static_assert(IsValidRep64<Rep>(0), "duration::rep is invalid");
|
1488
1572
|
return FromInt64(int64_t{d.count()}, Period{});
|
1489
1573
|
}
|
1490
1574
|
|
1491
1575
|
template <typename Ratio>
|
1492
|
-
int64_t ToInt64(Duration d, Ratio) {
|
1576
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToInt64(Duration d, Ratio) {
|
1493
1577
|
// Note: This may be used on MSVC, which may have a system_clock period of
|
1494
1578
|
// std::ratio<1, 10 * 1000 * 1000>
|
1495
1579
|
return ToInt64Seconds(d * Ratio::den / Ratio::num);
|
1496
1580
|
}
|
1497
1581
|
// Fastpath implementations for the 6 common duration units.
|
1498
|
-
inline int64_t ToInt64(Duration d, std::nano) {
|
1582
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d, std::nano) {
|
1499
1583
|
return ToInt64Nanoseconds(d);
|
1500
1584
|
}
|
1501
|
-
inline int64_t ToInt64(Duration d, std::micro) {
|
1585
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d, std::micro) {
|
1502
1586
|
return ToInt64Microseconds(d);
|
1503
1587
|
}
|
1504
|
-
inline int64_t ToInt64(Duration d, std::milli) {
|
1588
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d, std::milli) {
|
1505
1589
|
return ToInt64Milliseconds(d);
|
1506
1590
|
}
|
1507
|
-
inline int64_t ToInt64(Duration d,
|
1591
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d,
|
1592
|
+
std::ratio<1>) {
|
1508
1593
|
return ToInt64Seconds(d);
|
1509
1594
|
}
|
1510
|
-
inline int64_t ToInt64(Duration d,
|
1595
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d,
|
1596
|
+
std::ratio<60>) {
|
1511
1597
|
return ToInt64Minutes(d);
|
1512
1598
|
}
|
1513
|
-
inline int64_t ToInt64(Duration d,
|
1599
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION inline int64_t ToInt64(Duration d,
|
1600
|
+
std::ratio<3600>) {
|
1514
1601
|
return ToInt64Hours(d);
|
1515
1602
|
}
|
1516
1603
|
|
1517
1604
|
// Converts an absl::Duration to a chrono duration of type T.
|
1518
1605
|
template <typename T>
|
1519
|
-
T ToChronoDuration(Duration d) {
|
1606
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION T ToChronoDuration(Duration d) {
|
1520
1607
|
using Rep = typename T::rep;
|
1521
1608
|
using Period = typename T::period;
|
1522
1609
|
static_assert(IsValidRep64<Rep>(0), "duration::rep is invalid");
|
@@ -1530,7 +1617,8 @@ T ToChronoDuration(Duration d) {
|
|
1530
1617
|
|
1531
1618
|
} // namespace time_internal
|
1532
1619
|
|
1533
|
-
constexpr bool operator<(Duration lhs,
|
1620
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator<(Duration lhs,
|
1621
|
+
Duration rhs) {
|
1534
1622
|
return time_internal::GetRepHi(lhs) != time_internal::GetRepHi(rhs)
|
1535
1623
|
? time_internal::GetRepHi(lhs) < time_internal::GetRepHi(rhs)
|
1536
1624
|
: time_internal::GetRepHi(lhs) == (std::numeric_limits<int64_t>::min)()
|
@@ -1539,12 +1627,13 @@ constexpr bool operator<(Duration lhs, Duration rhs) {
|
|
1539
1627
|
: time_internal::GetRepLo(lhs) < time_internal::GetRepLo(rhs);
|
1540
1628
|
}
|
1541
1629
|
|
1542
|
-
constexpr bool operator==(Duration lhs,
|
1630
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr bool operator==(Duration lhs,
|
1631
|
+
Duration rhs) {
|
1543
1632
|
return time_internal::GetRepHi(lhs) == time_internal::GetRepHi(rhs) &&
|
1544
1633
|
time_internal::GetRepLo(lhs) == time_internal::GetRepLo(rhs);
|
1545
1634
|
}
|
1546
1635
|
|
1547
|
-
constexpr Duration operator-(Duration d) {
|
1636
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration operator-(Duration d) {
|
1548
1637
|
// This is a little interesting because of the special cases.
|
1549
1638
|
//
|
1550
1639
|
// If rep_lo_ is zero, we have it easy; it's safe to negate rep_hi_, we're
|
@@ -1570,47 +1659,53 @@ constexpr Duration operator-(Duration d) {
|
|
1570
1659
|
time_internal::GetRepLo(d));
|
1571
1660
|
}
|
1572
1661
|
|
1573
|
-
constexpr Duration InfiniteDuration() {
|
1662
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration InfiniteDuration() {
|
1574
1663
|
return time_internal::MakeDuration((std::numeric_limits<int64_t>::max)(),
|
1575
1664
|
~uint32_t{0});
|
1576
1665
|
}
|
1577
1666
|
|
1578
|
-
constexpr Duration FromChrono(
|
1667
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1668
|
+
const std::chrono::nanoseconds& d) {
|
1579
1669
|
return time_internal::FromChrono(d);
|
1580
1670
|
}
|
1581
|
-
constexpr Duration FromChrono(
|
1671
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1672
|
+
const std::chrono::microseconds& d) {
|
1582
1673
|
return time_internal::FromChrono(d);
|
1583
1674
|
}
|
1584
|
-
constexpr Duration FromChrono(
|
1675
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1676
|
+
const std::chrono::milliseconds& d) {
|
1585
1677
|
return time_internal::FromChrono(d);
|
1586
1678
|
}
|
1587
|
-
constexpr Duration FromChrono(
|
1679
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1680
|
+
const std::chrono::seconds& d) {
|
1588
1681
|
return time_internal::FromChrono(d);
|
1589
1682
|
}
|
1590
|
-
constexpr Duration FromChrono(
|
1683
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1684
|
+
const std::chrono::minutes& d) {
|
1591
1685
|
return time_internal::FromChrono(d);
|
1592
1686
|
}
|
1593
|
-
constexpr Duration FromChrono(
|
1687
|
+
ABSL_ATTRIBUTE_PURE_FUNCTION constexpr Duration FromChrono(
|
1688
|
+
const std::chrono::hours& d) {
|
1594
1689
|
return time_internal::FromChrono(d);
|
1595
1690
|
}
|
1596
1691
|
|
1597
|
-
constexpr Time FromUnixNanos(int64_t ns) {
|
1692
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixNanos(int64_t ns) {
|
1598
1693
|
return time_internal::FromUnixDuration(Nanoseconds(ns));
|
1599
1694
|
}
|
1600
1695
|
|
1601
|
-
constexpr Time FromUnixMicros(int64_t us) {
|
1696
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMicros(int64_t us) {
|
1602
1697
|
return time_internal::FromUnixDuration(Microseconds(us));
|
1603
1698
|
}
|
1604
1699
|
|
1605
|
-
constexpr Time FromUnixMillis(int64_t ms) {
|
1700
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMillis(int64_t ms) {
|
1606
1701
|
return time_internal::FromUnixDuration(Milliseconds(ms));
|
1607
1702
|
}
|
1608
1703
|
|
1609
|
-
constexpr Time FromUnixSeconds(int64_t s) {
|
1704
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixSeconds(int64_t s) {
|
1610
1705
|
return time_internal::FromUnixDuration(Seconds(s));
|
1611
1706
|
}
|
1612
1707
|
|
1613
|
-
constexpr Time FromTimeT(time_t t) {
|
1708
|
+
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromTimeT(time_t t) {
|
1614
1709
|
return time_internal::FromUnixDuration(Seconds(t));
|
1615
1710
|
}
|
1616
1711
|
|