grpc 1.71.0 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +78 -75
- data/include/grpc/event_engine/memory_request.h +3 -3
- data/include/grpc/impl/channel_arg_names.h +70 -50
- data/include/grpc/support/workaround_list.h +1 -4
- data/src/core/{lib/transport → call}/call_arena_allocator.cc +1 -1
- data/src/core/{lib/transport → call}/call_arena_allocator.h +3 -3
- data/src/core/{lib/transport → call}/call_destination.h +4 -4
- data/src/core/{lib/transport → call}/call_filters.cc +2 -2
- data/src/core/{lib/transport → call}/call_filters.h +25 -6
- data/src/core/{lib/channel → call}/call_finalization.h +3 -3
- data/src/core/{lib/transport → call}/call_spine.cc +1 -1
- data/src/core/{lib/transport → call}/call_spine.h +68 -26
- data/src/core/{lib/transport → call}/call_state.cc +1 -1
- data/src/core/{lib/transport → call}/call_state.h +3 -3
- data/src/core/{lib/surface → call}/client_call.cc +9 -7
- data/src/core/{lib/surface → call}/client_call.h +4 -4
- data/src/core/{lib/transport → call}/custom_metadata.h +3 -3
- data/src/core/{lib/transport → call}/interception_chain.cc +5 -5
- data/src/core/{lib/transport → call}/interception_chain.h +7 -7
- data/src/core/{lib/transport → call}/message.cc +1 -1
- data/src/core/{lib/transport → call}/message.h +7 -3
- data/src/core/{lib/transport → call}/metadata.cc +2 -2
- data/src/core/{lib/transport → call}/metadata.h +4 -4
- data/src/core/{lib/transport → call}/metadata_batch.cc +1 -1
- data/src/core/{lib/transport → call}/metadata_batch.h +7 -7
- data/src/core/{lib/transport → call}/metadata_compression_traits.h +3 -3
- data/src/core/{lib/transport → call}/metadata_info.cc +27 -9
- data/src/core/{lib/transport → call}/metadata_info.h +4 -4
- data/src/core/{lib/transport → call}/parsed_metadata.cc +1 -1
- data/src/core/{lib/transport → call}/parsed_metadata.h +3 -3
- data/src/core/call/request_buffer.h +3 -3
- data/src/core/call/security_context.cc +125 -0
- data/src/core/call/security_context.h +114 -0
- data/src/core/{lib/surface → call}/server_call.cc +3 -3
- data/src/core/{lib/surface → call}/server_call.h +5 -5
- data/src/core/{lib/transport → call}/simple_slice_based_metadata.h +4 -4
- data/src/core/{lib/channel → call}/status_util.cc +1 -1
- data/src/core/{lib/channel → call}/status_util.h +3 -3
- data/src/core/client_channel/client_channel.cc +24 -16
- data/src/core/client_channel/client_channel.h +4 -3
- data/src/core/client_channel/client_channel_filter.cc +10 -20
- data/src/core/client_channel/client_channel_filter.h +1 -1
- data/src/core/client_channel/client_channel_internal.h +1 -1
- data/src/core/client_channel/config_selector.h +2 -2
- data/src/core/client_channel/direct_channel.cc +2 -2
- data/src/core/client_channel/dynamic_filters.cc +0 -1
- data/src/core/client_channel/dynamic_filters.h +0 -1
- data/src/core/client_channel/lb_metadata.h +1 -1
- data/src/core/client_channel/load_balanced_call_destination.cc +1 -1
- data/src/core/client_channel/load_balanced_call_destination.h +1 -1
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +43 -41
- data/src/core/client_channel/retry_filter_legacy_call_data.h +6 -6
- data/src/core/client_channel/retry_interceptor.h +1 -1
- data/src/core/client_channel/retry_service_config.cc +1 -1
- data/src/core/client_channel/retry_service_config.h +1 -1
- data/src/core/client_channel/retry_throttle.cc +30 -34
- data/src/core/client_channel/retry_throttle.h +10 -2
- data/src/core/client_channel/subchannel.cc +7 -8
- data/src/core/client_channel/subchannel.h +1 -2
- data/src/core/client_channel/subchannel_stream_client.cc +14 -11
- data/src/core/client_channel/subchannel_stream_client.h +2 -2
- data/src/core/config/core_configuration.h +2 -2
- data/src/core/credentials/call/call_credentials.h +157 -0
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.h +4 -4
- data/src/core/{lib/security/credentials/composite/composite_credentials.cc → credentials/call/composite/composite_call_credentials.cc} +4 -57
- data/src/core/credentials/call/composite/composite_call_credentials.h +82 -0
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.cc +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.h +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.h +4 -4
- data/src/core/{lib/security/util → credentials/call}/json_util.cc +1 -1
- data/src/core/{lib/security/util → credentials/call}/json_util.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.cc +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.cc +4 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_linux.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_no_op.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_windows.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_client_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_server_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry_init.cc +21 -17
- data/src/core/credentials/transport/composite/composite_channel_credentials.cc +68 -0
- data/src/core/{lib/security/credentials/composite/composite_credentials.h → credentials/transport/composite/composite_channel_credentials.h} +6 -51
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.cc +4 -26
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.h +5 -37
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/credentials_generic.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.cc +31 -19
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.h +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.h +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.cc +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.h +4 -4
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_factory.h +3 -3
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.cc +1 -1
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_match.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.h +7 -7
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_fallback.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_windows.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.cc +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.cc +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.h +6 -6
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.h +3 -3
- data/src/core/{lib/security/credentials/credentials.cc → credentials/transport/transport_credentials.cc} +1 -3
- data/src/core/{lib/security/credentials/credentials.h → credentials/transport/transport_credentials.h} +5 -121
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.cc +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.h +6 -6
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +8 -5
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +2 -2
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.h +1 -1
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -2
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.h +1 -1
- data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
- data/src/core/ext/filters/message_size/message_size_filter.cc +1 -1
- data/src/core/ext/filters/rbac/rbac_filter.cc +2 -2
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +1 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +58 -57
- data/src/core/ext/transport/chttp2/transport/context_list_entry.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.cc +89 -68
- data/src/core/ext/transport/chttp2/transport/frame.h +37 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +6 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +10 -8
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +52 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +11 -14
- data/src/core/ext/transport/chttp2/transport/parsing.cc +36 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +15 -14
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +65 -65
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +14 -14
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +133 -133
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +71 -71
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +26 -26
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +216 -218
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +66 -66
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +326 -328
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +103 -103
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +58 -58
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +29 -29
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +186 -192
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +21 -21
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +59 -61
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +15 -15
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +100 -100
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +34 -34
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +12 -12
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +118 -118
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +39 -39
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +41 -41
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +139 -139
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +46 -46
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +33 -33
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +52 -54
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +620 -626
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +215 -215
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +13 -13
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +15 -15
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +16 -16
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +306 -312
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +96 -96
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +25 -25
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +34 -34
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +294 -294
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +105 -105
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +23 -23
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +84 -84
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +87 -87
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +31 -31
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +130 -132
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +43 -43
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +60 -60
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +26 -26
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +11 -11
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +85 -89
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +80 -83
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/google/api/http.upb.h +51 -51
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +22 -22
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +327 -301
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +97 -85
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +9 -11
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +9 -10
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +110 -113
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +25 -25
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +6 -6
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +21 -22
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +70 -72
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +17 -17
- data/src/core/ext/upb-gen/validate/validate.upb.h +368 -368
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +117 -117
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +9 -10
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +12 -12
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +27 -30
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +98 -87
- data/src/core/{lib/security/transport → filter/auth}/auth_filters.h +8 -7
- data/src/core/{lib/security/transport → filter/auth}/client_auth_filter.cc +7 -6
- data/src/core/{lib/security/transport → filter/auth}/server_auth_filter.cc +5 -4
- data/src/core/handshaker/handshaker.cc +0 -8
- data/src/core/handshaker/security/security_handshaker.cc +1 -1
- data/src/core/handshaker/security/security_handshaker.h +1 -1
- data/src/core/lib/channel/channel_args.h +49 -30
- data/src/core/lib/channel/channel_stack.h +1 -2
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/connected_channel.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.h +3 -3
- data/src/core/lib/debug/trace_flags.cc +2 -4
- data/src/core/lib/debug/trace_flags.h +1 -2
- data/src/core/lib/event_engine/default_event_engine_factory.cc +6 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +1 -1
- data/src/core/lib/event_engine/extensions/iomgr_compatible.h +39 -0
- data/src/core/lib/event_engine/extensions/supports_win_sockets.h +48 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +0 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +26 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +4 -0
- data/src/core/lib/event_engine/posix_engine/set_socket_dualstack.cc +64 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +0 -11
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/event_engine/shim.cc +9 -16
- data/src/core/lib/event_engine/shim.h +11 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +15 -7
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +2 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +11 -0
- data/src/core/lib/event_engine/windows/win_socket.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +5 -10
- data/src/core/lib/event_engine/windows/windows_engine.cc +42 -0
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -2
- data/src/core/lib/event_engine/windows/windows_listener.cc +5 -6
- data/src/core/lib/event_engine/windows/windows_listener.h +9 -4
- data/src/core/lib/experiments/experiments.cc +174 -21
- data/src/core/lib/experiments/experiments.h +70 -13
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +43 -16
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +43 -8
- data/src/core/lib/iomgr/error.cc +27 -43
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +13 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +13 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -7
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
- data/src/core/lib/iomgr/socket_utils_posix.cc +22 -11
- data/src/core/lib/iomgr/socket_utils_posix.h +12 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +8 -9
- data/src/core/lib/iomgr/tcp_client_posix.cc +11 -15
- data/src/core/lib/iomgr/tcp_client_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +58 -31
- data/src/core/lib/iomgr/tcp_posix.h +10 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +9 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +27 -16
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/promise/all_ok.h +31 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/map.h +65 -2
- data/src/core/lib/promise/party.h +5 -1
- data/src/core/lib/promise/poll.h +22 -20
- data/src/core/lib/promise/promise.h +2 -2
- data/src/core/lib/promise/status_flag.h +23 -11
- data/src/core/lib/security/authorization/evaluate_args.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.h +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/surface/call.cc +20 -18
- data/src/core/lib/surface/call_utils.cc +3 -3
- data/src/core/lib/surface/call_utils.h +3 -3
- data/src/core/lib/surface/channel.h +2 -2
- data/src/core/lib/surface/channel_init.h +2 -2
- data/src/core/lib/surface/completion_queue.cc +77 -17
- data/src/core/lib/surface/filter_stack_call.cc +40 -27
- data/src/core/lib/surface/filter_stack_call.h +1 -1
- data/src/core/lib/surface/init.cc +2 -3
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +27 -23
- data/src/core/lib/surface/legacy_channel.h +1 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/error_utils.cc +65 -11
- data/src/core/lib/transport/error_utils.h +2 -2
- data/src/core/lib/transport/status_conversion.cc +16 -14
- data/src/core/lib/transport/status_conversion.h +5 -4
- data/src/core/lib/transport/transport.h +5 -5
- data/src/core/lib/transport/transport_op_string.cc +1 -1
- data/src/core/load_balancing/delegating_helper.h +1 -1
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +1 -1
- data/src/core/load_balancing/grpclb/grpclb.cc +1 -2
- data/src/core/load_balancing/pick_first/pick_first.cc +0 -955
- data/src/core/load_balancing/rls/rls.cc +31 -37
- data/src/core/load_balancing/weighted_target/weighted_target.cc +1 -1
- data/src/core/load_balancing/xds/cds.cc +3 -10
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +1 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -2
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +1 -3
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +1 -1
- data/src/core/resolver/xds/xds_dependency_manager.cc +8 -3
- data/src/core/resolver/xds/xds_resolver.cc +2 -2
- data/src/core/server/server.cc +7 -4
- data/src/core/server/server.h +1 -1
- data/src/core/server/server_call_tracer_filter.cc +1 -1
- data/src/core/server/server_config_selector.h +1 -1
- data/src/core/server/server_config_selector_filter.cc +1 -1
- data/src/core/server/xds_server_config_fetcher.cc +5 -5
- data/src/core/service_config/service_config_channel_arg_filter.cc +1 -1
- data/src/core/telemetry/call_tracer.cc +2 -4
- data/src/core/telemetry/call_tracer.h +3 -3
- data/src/core/telemetry/metrics.cc +30 -12
- data/src/core/telemetry/metrics.h +15 -3
- data/src/core/telemetry/stats_data.cc +75 -2
- data/src/core/telemetry/stats_data.h +46 -4
- data/src/core/telemetry/tcp_tracer.h +90 -84
- data/src/core/{lib/security/context/security_context.cc → transport/auth_context.cc} +1 -96
- data/src/core/{lib/security/context/security_context.h → transport/auth_context.h} +6 -76
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/ssl_transport_security.cc +1 -1
- data/src/core/util/check_class_size.h +48 -0
- data/src/core/util/gcp_metadata_query.cc +1 -1
- data/src/core/util/http_client/httpcli.cc +3 -3
- data/src/core/util/http_client/httpcli_security_connector.cc +3 -3
- data/src/core/util/load_file.cc +26 -14
- data/src/core/util/status_helper.cc +86 -63
- data/src/core/util/status_helper.h +9 -26
- data/src/core/xds/grpc/certificate_provider_store.cc +1 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +1 -1
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +10 -7
- data/src/core/xds/grpc/xds_certificate_provider.cc +1 -1
- data/src/core/xds/grpc/xds_certificate_provider.h +2 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +7 -6
- data/src/core/xds/grpc/xds_client_grpc.h +4 -2
- data/src/core/xds/grpc/xds_cluster.h +3 -3
- data/src/core/xds/grpc/xds_cluster_parser.cc +3 -2
- data/src/core/xds/grpc/xds_http_fault_filter.cc +1 -1
- data/src/core/xds/grpc/xds_http_filter.h +1 -1
- data/src/core/xds/grpc/xds_http_filter_registry.h +1 -1
- data/src/core/xds/grpc/xds_route_config.h +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.h +1 -1
- data/src/core/xds/grpc/xds_routing.h +1 -1
- data/src/core/xds/grpc/xds_server_grpc.cc +60 -48
- data/src/core/xds/grpc/xds_server_grpc.h +23 -13
- data/src/core/xds/grpc/xds_server_grpc_interface.h +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +5 -5
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -3
- data/src/core/xds/xds_client/lrs_client.cc +6 -5
- data/src/core/xds/xds_client/lrs_client.h +7 -7
- data/src/core/xds/xds_client/xds_bootstrap.h +16 -1
- data/src/core/xds/xds_client/xds_client.cc +25 -23
- data/src/core/xds/xds_client/xds_client.h +3 -1
- data/src/core/xds/xds_client/xds_resource_type.h +1 -2
- data/src/core/xds/xds_client/xds_transport.h +1 -1
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/crypto.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +20 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -25
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +3 -7
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +13 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +2 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +1 -1
- data/third_party/upb/upb/base/internal/log2.h +3 -1
- data/third_party/upb/upb/base/string_view.h +10 -0
- data/third_party/upb/upb/hash/common.c +5 -1
- data/third_party/upb/upb/json/decode.c +2 -2
- data/third_party/upb/upb/json/decode.h +0 -1
- data/third_party/upb/upb/mem/alloc.h +5 -0
- data/third_party/upb/upb/mem/arena.c +296 -142
- data/third_party/upb/upb/mem/arena.h +47 -11
- data/third_party/upb/upb/mem/arena.hpp +4 -20
- data/third_party/upb/upb/mem/internal/arena.h +4 -6
- data/third_party/upb/upb/message/accessors.h +41 -0
- data/third_party/upb/upb/message/compat.c +11 -14
- data/third_party/upb/upb/message/compat.h +4 -3
- data/third_party/upb/upb/message/copy.c +35 -30
- data/third_party/upb/upb/message/internal/accessors.h +139 -10
- data/third_party/upb/upb/message/internal/extension.c +28 -25
- data/third_party/upb/upb/message/internal/extension.h +21 -5
- data/third_party/upb/upb/message/internal/iterator.c +58 -0
- data/third_party/upb/upb/message/internal/iterator.h +29 -0
- data/third_party/upb/upb/message/internal/map.h +2 -3
- data/third_party/upb/upb/message/internal/map_sorter.h +3 -2
- data/third_party/upb/upb/message/internal/message.c +48 -29
- data/third_party/upb/upb/message/internal/message.h +154 -24
- data/third_party/upb/upb/message/map_sorter.c +20 -8
- data/third_party/upb/upb/message/message.c +90 -38
- data/third_party/upb/upb/message/message.h +58 -2
- data/third_party/upb/upb/message/value.h +9 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +1 -1
- data/third_party/upb/upb/mini_descriptor/decode.c +97 -136
- data/third_party/upb/upb/mini_descriptor/decode.h +4 -3
- data/third_party/upb/upb/mini_descriptor/internal/encode.hpp +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.c +24 -12
- data/third_party/upb/upb/mini_table/extension_registry.h +13 -6
- data/third_party/upb/upb/mini_table/message.c +21 -13
- data/third_party/upb/upb/port/atomic.h +134 -7
- data/third_party/upb/upb/port/def.inc +140 -38
- data/third_party/upb/upb/port/undef.inc +11 -1
- data/third_party/upb/upb/reflection/def.hpp +5 -1
- data/third_party/upb/upb/reflection/def_pool.c +10 -3
- data/third_party/upb/upb/reflection/descriptor_bootstrap.h +1 -1
- data/third_party/upb/upb/reflection/file_def.c +12 -5
- data/third_party/upb/upb/reflection/internal/def_builder.c +1 -1
- data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
- data/third_party/upb/upb/reflection/message.c +19 -16
- data/third_party/upb/upb/reflection/message.h +3 -1
- data/third_party/upb/upb/text/encode.c +1 -13
- data/third_party/upb/upb/text/internal/encode.c +25 -6
- data/third_party/upb/upb/text/internal/encode.h +4 -0
- data/third_party/upb/upb/wire/decode.c +60 -45
- data/third_party/upb/upb/wire/decode.h +4 -2
- data/third_party/upb/upb/wire/encode.c +77 -42
- data/third_party/upb/upb/wire/encode.h +2 -0
- data/third_party/upb/upb/wire/eps_copy_input_stream.h +18 -20
- data/third_party/upb/upb/wire/internal/decoder.h +4 -11
- data/third_party/utf8_range/utf8_range.c +15 -275
- data/third_party/utf8_range/utf8_range_neon.inc +117 -0
- data/third_party/utf8_range/utf8_range_sse.inc +272 -0
- data/third_party/zlib/deflate.c +40 -15
- data/third_party/zlib/deflate.h +33 -2
- data/third_party/zlib/gzguts.h +2 -6
- data/third_party/zlib/inflate.c +1 -1
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/inftrees.h +2 -2
- data/third_party/zlib/trees.c +18 -4
- data/third_party/zlib/zconf.h +1 -9
- data/third_party/zlib/zlib.h +12 -12
- data/third_party/zlib/zutil.h +4 -25
- metadata +155 -145
- data/include/grpc/grpc_cronet.h +0 -37
- data/src/core/lib/transport/http2_errors.h +0 -43
- data/third_party/upb/upb/message/internal/compare_unknown.c +0 -289
- data/third_party/upb/upb/message/internal/compare_unknown.h +0 -49
@@ -7,10 +7,12 @@
|
|
7
7
|
|
8
8
|
#include "upb/message/message.h"
|
9
9
|
|
10
|
+
#include <stdarg.h>
|
10
11
|
#include <stddef.h>
|
11
12
|
#include <stdint.h>
|
12
13
|
#include <string.h>
|
13
14
|
|
15
|
+
#include "upb/base/string_view.h"
|
14
16
|
#include "upb/mem/arena.h"
|
15
17
|
#include "upb/message/accessors.h"
|
16
18
|
#include "upb/message/array.h"
|
@@ -28,64 +30,109 @@
|
|
28
30
|
// Must be last.
|
29
31
|
#include "upb/port/def.inc"
|
30
32
|
|
31
|
-
static const size_t message_overhead = sizeof(upb_Message_Internal);
|
32
|
-
|
33
33
|
upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* a) {
|
34
34
|
return _upb_Message_New(m, a);
|
35
35
|
}
|
36
36
|
|
37
37
|
bool UPB_PRIVATE(_upb_Message_AddUnknown)(upb_Message* msg, const char* data,
|
38
|
-
size_t len, upb_Arena* arena
|
38
|
+
size_t len, upb_Arena* arena,
|
39
|
+
bool alias) {
|
39
40
|
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
40
|
-
|
41
|
+
// TODO: b/376969853 - Add debug check that the unknown field is an overall
|
42
|
+
// valid proto field
|
43
|
+
if (!UPB_PRIVATE(_upb_Message_ReserveSlot)(msg, arena)) {
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
upb_StringView* view;
|
47
|
+
if (alias) {
|
48
|
+
view = upb_Arena_Malloc(arena, sizeof(upb_StringView));
|
49
|
+
if (!view) return false;
|
50
|
+
view->data = data;
|
51
|
+
} else {
|
52
|
+
view = upb_Arena_Malloc(arena, sizeof(upb_StringView) + len);
|
53
|
+
if (!view) return false;
|
54
|
+
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
|
55
|
+
memcpy(copy, data, len);
|
56
|
+
view->data = copy;
|
57
|
+
}
|
58
|
+
view->size = len;
|
41
59
|
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
42
|
-
|
43
|
-
in->unknown_end += len;
|
60
|
+
in->aux_data[in->size++] = upb_TaggedAuxPtr_MakeUnknownData(view);
|
44
61
|
return true;
|
45
62
|
}
|
46
63
|
|
47
|
-
|
64
|
+
bool UPB_PRIVATE(_upb_Message_AddUnknownV)(struct upb_Message* msg,
|
65
|
+
upb_Arena* arena,
|
66
|
+
upb_StringView data[],
|
67
|
+
size_t count) {
|
48
68
|
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
49
|
-
|
50
|
-
|
51
|
-
|
69
|
+
UPB_ASSERT(count > 0);
|
70
|
+
size_t total_len = 0;
|
71
|
+
for (size_t i = 0; i < count; i++) {
|
72
|
+
total_len += data[i].size;
|
73
|
+
}
|
74
|
+
if (!UPB_PRIVATE(_upb_Message_ReserveSlot)(msg, arena)) return false;
|
75
|
+
|
76
|
+
upb_StringView* view =
|
77
|
+
upb_Arena_Malloc(arena, sizeof(upb_StringView) + total_len);
|
78
|
+
if (!view) return false;
|
79
|
+
char* copy = UPB_PTR_AT(view, sizeof(upb_StringView), char);
|
80
|
+
view->data = copy;
|
81
|
+
view->size = total_len;
|
82
|
+
for (size_t i = 0; i < count; i++) {
|
83
|
+
memcpy(copy, data[i].data, data[i].size);
|
84
|
+
copy += data[i].size;
|
52
85
|
}
|
86
|
+
// TODO: b/376969853 - Add debug check that the unknown field is an overall
|
87
|
+
// valid proto field
|
88
|
+
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
89
|
+
in->aux_data[in->size++] = upb_TaggedAuxPtr_MakeUnknownData(view);
|
90
|
+
return true;
|
53
91
|
}
|
54
92
|
|
55
|
-
|
93
|
+
void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) {
|
94
|
+
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
56
95
|
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
57
|
-
if (in)
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
96
|
+
if (!in) return;
|
97
|
+
uint32_t size = 0;
|
98
|
+
for (uint32_t i = 0; i < in->size; i++) {
|
99
|
+
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
|
100
|
+
if (upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
|
101
|
+
in->aux_data[size++] = tagged_ptr;
|
102
|
+
}
|
63
103
|
}
|
104
|
+
in->size = size;
|
64
105
|
}
|
65
106
|
|
66
|
-
|
107
|
+
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
|
108
|
+
uintptr_t* iter) {
|
67
109
|
UPB_ASSERT(!upb_Message_IsFrozen(msg));
|
110
|
+
UPB_ASSERT(*iter != kUpb_Message_UnknownBegin);
|
68
111
|
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
69
|
-
|
70
|
-
|
112
|
+
UPB_ASSERT(in);
|
113
|
+
UPB_ASSERT(*iter <= in->size);
|
71
114
|
#ifndef NDEBUG
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
UPB_ASSERT(
|
76
|
-
UPB_ASSERT(
|
77
|
-
UPB_ASSERT((uintptr_t)(data + len) <= (uintptr_t)internal_unknown_end);
|
115
|
+
upb_TaggedAuxPtr unknown_ptr = in->aux_data[*iter - 1];
|
116
|
+
UPB_ASSERT(upb_TaggedAuxPtr_IsUnknown(unknown_ptr));
|
117
|
+
upb_StringView* unknown = upb_TaggedAuxPtr_UnknownData(unknown_ptr);
|
118
|
+
UPB_ASSERT(unknown->data == data->data);
|
119
|
+
UPB_ASSERT(unknown->size == data->size);
|
78
120
|
#endif
|
121
|
+
in->aux_data[*iter - 1] = upb_TaggedAuxPtr_Null();
|
79
122
|
|
80
|
-
|
81
|
-
memmove((char*)data, data + len, internal_unknown_end - data - len);
|
82
|
-
}
|
83
|
-
in->unknown_end -= len;
|
123
|
+
return upb_Message_NextUnknown(msg, data, iter);
|
84
124
|
}
|
85
125
|
|
86
126
|
size_t upb_Message_ExtensionCount(const upb_Message* msg) {
|
87
|
-
|
88
|
-
|
127
|
+
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
128
|
+
if (!in) return 0;
|
129
|
+
const upb_MiniTableExtension* ext;
|
130
|
+
upb_MessageValue val;
|
131
|
+
uintptr_t iter = kUpb_Message_ExtensionBegin;
|
132
|
+
size_t count = 0;
|
133
|
+
while (upb_Message_NextExtension(msg, &ext, &val, &iter)) {
|
134
|
+
count++;
|
135
|
+
}
|
89
136
|
return count;
|
90
137
|
}
|
91
138
|
|
@@ -126,16 +173,21 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) {
|
|
126
173
|
}
|
127
174
|
|
128
175
|
// Extensions.
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
for (size_t i = 0; i <
|
133
|
-
|
176
|
+
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
|
177
|
+
// TODO: b/376969853 - use iterator API
|
178
|
+
uint32_t size = in ? in->size : 0;
|
179
|
+
for (size_t i = 0; i < size; i++) {
|
180
|
+
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
|
181
|
+
if (!upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
|
182
|
+
continue;
|
183
|
+
}
|
184
|
+
const upb_Extension* ext = upb_TaggedAuxPtr_Extension(tagged_ptr);
|
185
|
+
const upb_MiniTableExtension* e = ext->ext;
|
134
186
|
const upb_MiniTableField* f = &e->UPB_PRIVATE(field);
|
135
187
|
const upb_MiniTable* m2 = upb_MiniTableExtension_GetSubMessage(e);
|
136
188
|
|
137
189
|
upb_MessageValue val;
|
138
|
-
memcpy(&val, &ext
|
190
|
+
memcpy(&val, &(ext->data), sizeof(upb_MessageValue));
|
139
191
|
|
140
192
|
switch (UPB_PRIVATE(_upb_MiniTableField_Mode)(f)) {
|
141
193
|
case kUpb_FieldMode_Array: {
|
@@ -13,10 +13,15 @@
|
|
13
13
|
#define UPB_MESSAGE_MESSAGE_H_
|
14
14
|
|
15
15
|
#include <stddef.h>
|
16
|
+
#include <stdint.h>
|
16
17
|
|
18
|
+
#include "upb/base/string_view.h"
|
17
19
|
#include "upb/mem/arena.h"
|
20
|
+
#include "upb/message/array.h"
|
21
|
+
#include "upb/message/internal/extension.h"
|
18
22
|
#include "upb/message/internal/message.h"
|
19
23
|
#include "upb/message/internal/types.h"
|
24
|
+
#include "upb/mini_table/extension.h"
|
20
25
|
#include "upb/mini_table/message.h"
|
21
26
|
|
22
27
|
// Must be last.
|
@@ -31,15 +36,66 @@ extern "C" {
|
|
31
36
|
// Creates a new message with the given mini_table on the given arena.
|
32
37
|
UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena);
|
33
38
|
|
39
|
+
//
|
40
|
+
// Unknown data may be stored non-contiguously. Each segment stores a block of
|
41
|
+
// unknown fields. To iterate over segments:
|
42
|
+
//
|
43
|
+
// uintptr_t iter = kUpb_Message_UnknownBegin;
|
44
|
+
// upb_StringView data;
|
45
|
+
// while (upb_Message_NextUnknown(msg, &data, &iter)) {
|
46
|
+
// // Use data
|
47
|
+
// }
|
48
|
+
// Iterates in the order unknown fields were parsed.
|
49
|
+
|
50
|
+
#define kUpb_Message_UnknownBegin 0
|
51
|
+
#define kUpb_Message_ExtensionBegin 0
|
52
|
+
|
53
|
+
UPB_INLINE bool upb_Message_NextUnknown(const upb_Message* msg,
|
54
|
+
upb_StringView* data, uintptr_t* iter);
|
55
|
+
|
56
|
+
UPB_INLINE bool upb_Message_HasUnknown(const upb_Message* msg);
|
57
|
+
|
34
58
|
// Returns a reference to the message's unknown data.
|
35
59
|
const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
|
36
60
|
|
37
|
-
// Removes
|
38
|
-
|
61
|
+
// Removes a segment of unknown data from the message, advancing to the next
|
62
|
+
// segment. Returns false if the removed segment was at the end of the last
|
63
|
+
// chunk.
|
64
|
+
//
|
65
|
+
// This must be done while iterating:
|
66
|
+
//
|
67
|
+
// uintptr_t iter = kUpb_Message_UnknownBegin;
|
68
|
+
// upb_StringView data;
|
69
|
+
// // Iterate chunks
|
70
|
+
// while (upb_Message_NextUnknown(msg, &data, &iter)) {
|
71
|
+
// // Iterate within a chunk, deleting ranges
|
72
|
+
// while (ShouldDeleteSubSegment(&data)) {
|
73
|
+
// // Data now points to the region to be deleted
|
74
|
+
// if (!upb_Message_DeleteUnknown(msg, &data, &iter)) return;
|
75
|
+
// // If DeleteUnknown returned true, then data now points to the
|
76
|
+
// // remaining unknown fields after the region that was just deleted.
|
77
|
+
// }
|
78
|
+
// }
|
79
|
+
//
|
80
|
+
// The range given in `data` must be contained inside the most recently
|
81
|
+
// returned region.
|
82
|
+
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
|
83
|
+
uintptr_t* iter);
|
39
84
|
|
40
85
|
// Returns the number of extensions present in this message.
|
41
86
|
size_t upb_Message_ExtensionCount(const upb_Message* msg);
|
42
87
|
|
88
|
+
// Iterates extensions in wire order
|
89
|
+
UPB_INLINE bool upb_Message_NextExtension(const upb_Message* msg,
|
90
|
+
const upb_MiniTableExtension** out_e,
|
91
|
+
upb_MessageValue* out_v,
|
92
|
+
uintptr_t* iter);
|
93
|
+
|
94
|
+
// Iterates extensions in reverse wire order
|
95
|
+
UPB_INLINE bool UPB_PRIVATE(_upb_Message_NextExtensionReverse)(
|
96
|
+
const struct upb_Message* msg, const upb_MiniTableExtension** out_e,
|
97
|
+
upb_MessageValue* out_v, uintptr_t* iter);
|
98
|
+
|
43
99
|
// Mark a message and all of its descendents as frozen/immutable.
|
44
100
|
UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
|
45
101
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include <string.h>
|
16
16
|
|
17
17
|
#include "upb/base/string_view.h"
|
18
|
+
#include "upb/message/internal/types.h"
|
18
19
|
|
19
20
|
// Must be last.
|
20
21
|
#include "upb/port/def.inc"
|
@@ -41,6 +42,14 @@ typedef union {
|
|
41
42
|
// documentation in kUpb_DecodeOption_ExperimentalAllowUnlinked for more
|
42
43
|
// information.
|
43
44
|
uintptr_t tagged_msg_val; // upb_TaggedMessagePtr
|
45
|
+
|
46
|
+
// For an extension field, we are essentially treating ext->data (a
|
47
|
+
// upb_MessageValue) as if it were a message with one field that lives at
|
48
|
+
// offset 0. This works because upb_MessageValue is precisely one value that
|
49
|
+
// can hold any type of data. Recall that an extension can be of any type
|
50
|
+
// (scalar, repeated, or message). For a message extension, that will be a
|
51
|
+
// single upb_Message* at offset 0 of the upb_MessageValue.
|
52
|
+
struct upb_Message UPB_PRIVATE(ext_msg_val);
|
44
53
|
} upb_MessageValue;
|
45
54
|
|
46
55
|
UPB_API_INLINE upb_MessageValue upb_MessageValue_Zero(void) {
|
@@ -31,7 +31,7 @@ typedef struct {
|
|
31
31
|
} upb_MdEnumDecoder;
|
32
32
|
|
33
33
|
static size_t upb_MiniTableEnum_Size(size_t count) {
|
34
|
-
return
|
34
|
+
return UPB_SIZEOF_FLEX(upb_MiniTableEnum, UPB_PRIVATE(data), count);
|
35
35
|
}
|
36
36
|
|
37
37
|
static upb_MiniTableEnum* _upb_MiniTable_AddEnumDataMember(upb_MdEnumDecoder* d,
|
@@ -13,12 +13,11 @@
|
|
13
13
|
#include <stdlib.h>
|
14
14
|
|
15
15
|
#include "upb/base/descriptor_constants.h"
|
16
|
-
#include "upb/base/internal/log2.h"
|
17
16
|
#include "upb/base/status.h"
|
18
17
|
#include "upb/base/string_view.h"
|
18
|
+
#include "upb/mem/alloc.h"
|
19
19
|
#include "upb/mem/arena.h"
|
20
20
|
#include "upb/message/internal/map_entry.h"
|
21
|
-
#include "upb/message/internal/types.h"
|
22
21
|
#include "upb/mini_descriptor/internal/base92.h"
|
23
22
|
#include "upb/mini_descriptor/internal/decoder.h"
|
24
23
|
#include "upb/mini_descriptor/internal/modifiers.h"
|
@@ -40,39 +39,36 @@
|
|
40
39
|
// 64 is the first hasbit that we currently use.
|
41
40
|
#define kUpb_Reserved_Hasbits (kUpb_Reserved_Hasbytes * 8)
|
42
41
|
|
43
|
-
|
44
|
-
typedef enum {
|
45
|
-
kUpb_LayoutItemType_OneofCase, // Oneof case.
|
46
|
-
kUpb_LayoutItemType_OneofField, // Oneof field data.
|
47
|
-
kUpb_LayoutItemType_Field, // Non-oneof field data.
|
42
|
+
#define kUpb_OneOfLayoutItem_IndexSentinel ((uint16_t)-1)
|
48
43
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
#define kUpb_LayoutItem_IndexSentinel ((uint16_t) - 1)
|
44
|
+
// Stores the field number of the present value of the oneof
|
45
|
+
#define kUpb_OneOf_CaseFieldRep (kUpb_FieldRep_4Byte)
|
53
46
|
|
54
47
|
typedef struct {
|
55
|
-
// Index of the corresponding field.
|
56
|
-
//
|
48
|
+
// Index of the corresponding field. The field's offset will be the index of
|
49
|
+
// the next field in a linked list.
|
57
50
|
uint16_t field_index;
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}
|
51
|
+
// This enum is stored in bytes to avoid trailing padding while preserving
|
52
|
+
// two-byte alignment.
|
53
|
+
uint8_t /* upb_FieldRep*/ rep;
|
54
|
+
} upb_OneOfLayoutItem;
|
62
55
|
|
63
56
|
typedef struct {
|
64
|
-
|
57
|
+
upb_OneOfLayoutItem* data;
|
65
58
|
size_t size;
|
66
|
-
size_t
|
67
|
-
}
|
59
|
+
size_t buf_capacity_bytes;
|
60
|
+
} upb_OneOfLayoutItemVector;
|
68
61
|
|
69
62
|
typedef struct {
|
70
63
|
upb_MdDecoder base;
|
71
64
|
upb_MiniTable* table;
|
72
65
|
upb_MiniTableField* fields;
|
73
66
|
upb_MiniTablePlatform platform;
|
74
|
-
|
67
|
+
upb_OneOfLayoutItemVector oneofs;
|
75
68
|
upb_Arena* arena;
|
69
|
+
// Initially tracks the count of each field rep type; then, during assignment,
|
70
|
+
// tracks the base offset for the next processed field of the given rep.
|
71
|
+
uint16_t rep_counts_offsets[kUpb_FieldRep_Max + 1];
|
76
72
|
} upb_MtDecoder;
|
77
73
|
|
78
74
|
// In each field's offset, we temporarily store a presence classifier:
|
@@ -258,30 +254,24 @@ static void upb_MtDecoder_ModifyField(upb_MtDecoder* d,
|
|
258
254
|
}
|
259
255
|
}
|
260
256
|
|
261
|
-
static void
|
262
|
-
|
263
|
-
|
264
|
-
d->vec.data = realloc(d->vec.data, new_cap * sizeof(*d->vec.data));
|
265
|
-
upb_MdDecoder_CheckOutOfMemory(&d->base, d->vec.data);
|
266
|
-
d->vec.capacity = new_cap;
|
267
|
-
}
|
268
|
-
d->vec.data[d->vec.size++] = item;
|
269
|
-
}
|
270
|
-
|
271
|
-
static void upb_MtDecoder_PushOneof(upb_MtDecoder* d, upb_LayoutItem item) {
|
272
|
-
if (item.field_index == kUpb_LayoutItem_IndexSentinel) {
|
257
|
+
static void upb_MtDecoder_PushOneof(upb_MtDecoder* d,
|
258
|
+
upb_OneOfLayoutItem item) {
|
259
|
+
if (item.field_index == kUpb_OneOfLayoutItem_IndexSentinel) {
|
273
260
|
upb_MdDecoder_ErrorJmp(&d->base, "Empty oneof");
|
274
261
|
}
|
262
|
+
if ((d->oneofs.size + 1) * sizeof(*d->oneofs.data) >
|
263
|
+
d->oneofs.buf_capacity_bytes) {
|
264
|
+
size_t new_cap = UPB_MAX(8, d->oneofs.size * 2) * sizeof(*d->oneofs.data);
|
265
|
+
d->oneofs.data =
|
266
|
+
upb_grealloc(d->oneofs.data, d->oneofs.buf_capacity_bytes, new_cap);
|
267
|
+
upb_MdDecoder_CheckOutOfMemory(&d->base, d->oneofs.data);
|
268
|
+
d->oneofs.buf_capacity_bytes = new_cap;
|
269
|
+
}
|
275
270
|
item.field_index -= kOneofBase;
|
276
271
|
|
277
|
-
|
278
|
-
item.
|
279
|
-
|
280
|
-
|
281
|
-
// Push oneof case.
|
282
|
-
item.rep = kUpb_FieldRep_4Byte; // Field Number.
|
283
|
-
item.type = kUpb_LayoutItemType_OneofCase;
|
284
|
-
upb_MtDecoder_PushItem(d, item);
|
272
|
+
d->rep_counts_offsets[kUpb_OneOf_CaseFieldRep]++;
|
273
|
+
d->rep_counts_offsets[item.rep]++;
|
274
|
+
d->oneofs.data[d->oneofs.size++] = item;
|
285
275
|
}
|
286
276
|
|
287
277
|
static size_t upb_MtDecoder_SizeOfRep(upb_FieldRep rep,
|
@@ -327,7 +317,7 @@ static size_t upb_MtDecoder_AlignOfRep(upb_FieldRep rep,
|
|
327
317
|
static const char* upb_MtDecoder_DecodeOneofField(upb_MtDecoder* d,
|
328
318
|
const char* ptr,
|
329
319
|
char first_ch,
|
330
|
-
|
320
|
+
upb_OneOfLayoutItem* item) {
|
331
321
|
uint32_t field_num;
|
332
322
|
ptr = upb_MdDecoder_DecodeBase92Varint(
|
333
323
|
&d->base, ptr, first_ch, kUpb_EncodedValue_MinOneofField,
|
@@ -363,8 +353,8 @@ static const char* upb_MtDecoder_DecodeOneofField(upb_MtDecoder* d,
|
|
363
353
|
|
364
354
|
static const char* upb_MtDecoder_DecodeOneofs(upb_MtDecoder* d,
|
365
355
|
const char* ptr) {
|
366
|
-
|
367
|
-
|
356
|
+
upb_OneOfLayoutItem item = {
|
357
|
+
.rep = 0, .field_index = kUpb_OneOfLayoutItem_IndexSentinel};
|
368
358
|
while (ptr < d->base.end) {
|
369
359
|
char ch = *ptr++;
|
370
360
|
if (ch == kUpb_EncodedValue_FieldSeparator) {
|
@@ -372,7 +362,8 @@ static const char* upb_MtDecoder_DecodeOneofs(upb_MtDecoder* d,
|
|
372
362
|
} else if (ch == kUpb_EncodedValue_OneofSeparator) {
|
373
363
|
// End of oneof.
|
374
364
|
upb_MtDecoder_PushOneof(d, item);
|
375
|
-
item.field_index =
|
365
|
+
item.field_index =
|
366
|
+
kUpb_OneOfLayoutItem_IndexSentinel; // Move to next oneof.
|
376
367
|
} else {
|
377
368
|
ptr = upb_MtDecoder_DecodeOneofField(d, ptr, ch, &item);
|
378
369
|
}
|
@@ -511,45 +502,42 @@ static void upb_MtDecoder_ParseMessage(upb_MtDecoder* d, const char* data,
|
|
511
502
|
upb_MtDecoder_AllocateSubs(d, sub_counts);
|
512
503
|
}
|
513
504
|
|
514
|
-
static
|
515
|
-
|
516
|
-
const upb_LayoutItem* b = _b;
|
517
|
-
// Currently we just sort by:
|
518
|
-
// 1. rep (smallest fields first)
|
519
|
-
// 2. type (oneof cases first)
|
520
|
-
// 2. field_index (smallest numbers first)
|
521
|
-
// The main goal of this is to reduce space lost to padding.
|
522
|
-
// Later we may have more subtle reasons to prefer a different ordering.
|
523
|
-
const int rep_bits = upb_Log2Ceiling(kUpb_FieldRep_Max);
|
524
|
-
const int type_bits = upb_Log2Ceiling(kUpb_LayoutItemType_Max);
|
525
|
-
const int idx_bits = (sizeof(a->field_index) * 8);
|
526
|
-
UPB_ASSERT(idx_bits + rep_bits + type_bits < 32);
|
527
|
-
#define UPB_COMBINE(rep, ty, idx) (((rep << type_bits) | ty) << idx_bits) | idx
|
528
|
-
uint32_t a_packed = UPB_COMBINE(a->rep, a->type, a->field_index);
|
529
|
-
uint32_t b_packed = UPB_COMBINE(b->rep, b->type, b->field_index);
|
530
|
-
UPB_ASSERT(a_packed != b_packed);
|
531
|
-
#undef UPB_COMBINE
|
532
|
-
return a_packed < b_packed ? -1 : 1;
|
533
|
-
}
|
534
|
-
|
535
|
-
static bool upb_MtDecoder_SortLayoutItems(upb_MtDecoder* d) {
|
536
|
-
// Add items for all non-oneof fields (oneofs were already added).
|
505
|
+
static void upb_MtDecoder_CalculateAlignments(upb_MtDecoder* d) {
|
506
|
+
// Add alignment counts for non-oneof fields (oneofs were added already)
|
537
507
|
int n = d->table->UPB_PRIVATE(field_count);
|
538
508
|
for (int i = 0; i < n; i++) {
|
539
509
|
upb_MiniTableField* f = &d->fields[i];
|
540
510
|
if (f->UPB_PRIVATE(offset) >= kOneofBase) continue;
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
511
|
+
d->rep_counts_offsets[f->UPB_PRIVATE(mode) >> kUpb_FieldRep_Shift]++;
|
512
|
+
}
|
513
|
+
|
514
|
+
// Reserve properly aligned space for each type of field representation
|
515
|
+
// present in this message. When we iterate over the fields, they will obtain
|
516
|
+
// their offset from within the region matching their alignment requirements.
|
517
|
+
size_t base = d->table->UPB_PRIVATE(size);
|
518
|
+
// Start with the lowest alignment requirement, going up, because:
|
519
|
+
// 1. If there are presence bits, we won't be aligned to start, but adding
|
520
|
+
// some lower-alignment fields may get us closer without wasting space to
|
521
|
+
// padding.
|
522
|
+
// 2. The allocator enforces 8 byte alignment, so moving intermediate padding
|
523
|
+
// to trailing padding doesn't save us anything.
|
524
|
+
for (upb_FieldRep rep = kUpb_FieldRep_1Byte; rep <= kUpb_FieldRep_Max;
|
525
|
+
rep++) {
|
526
|
+
uint16_t count = d->rep_counts_offsets[rep];
|
527
|
+
if (count) {
|
528
|
+
base = UPB_ALIGN_UP(base, upb_MtDecoder_AlignOfRep(rep, d->platform));
|
529
|
+
// This entry now tracks the base offset for this field representation
|
530
|
+
// type, instead of the count
|
531
|
+
d->rep_counts_offsets[rep] = base;
|
532
|
+
base += upb_MtDecoder_SizeOfRep(rep, d->platform) * count;
|
533
|
+
}
|
545
534
|
}
|
546
|
-
|
547
|
-
if (
|
548
|
-
|
549
|
-
|
535
|
+
static const size_t max = UINT16_MAX;
|
536
|
+
if (base > max) {
|
537
|
+
upb_MdDecoder_ErrorJmp(
|
538
|
+
&d->base, "Message size exceeded maximum size of %zu bytes", max);
|
550
539
|
}
|
551
|
-
|
552
|
-
return true;
|
540
|
+
d->table->UPB_PRIVATE(size) = (uint16_t)base;
|
553
541
|
}
|
554
542
|
|
555
543
|
static size_t upb_MiniTable_DivideRoundUp(size_t n, size_t d) {
|
@@ -592,57 +580,33 @@ static void upb_MtDecoder_AssignHasbits(upb_MtDecoder* d) {
|
|
592
580
|
|
593
581
|
static size_t upb_MtDecoder_Place(upb_MtDecoder* d, upb_FieldRep rep) {
|
594
582
|
size_t size = upb_MtDecoder_SizeOfRep(rep, d->platform);
|
595
|
-
size_t
|
596
|
-
|
597
|
-
|
598
|
-
size_t new_size = ret + size;
|
599
|
-
if (new_size > max) {
|
600
|
-
upb_MdDecoder_ErrorJmp(
|
601
|
-
&d->base, "Message size exceeded maximum size of %zu bytes", max);
|
602
|
-
}
|
603
|
-
d->table->UPB_PRIVATE(size) = new_size;
|
604
|
-
return ret;
|
583
|
+
size_t offset = d->rep_counts_offsets[rep];
|
584
|
+
d->rep_counts_offsets[rep] += size;
|
585
|
+
return offset;
|
605
586
|
}
|
606
587
|
|
607
588
|
static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) {
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
589
|
+
upb_MiniTableField* field_end =
|
590
|
+
UPB_PTRADD(d->fields, d->table->UPB_PRIVATE(field_count));
|
591
|
+
for (upb_MiniTableField* field = d->fields; field < field_end; field++) {
|
592
|
+
if (field->UPB_PRIVATE(offset) >= kOneofBase) continue;
|
593
|
+
field->UPB_PRIVATE(offset) =
|
594
|
+
upb_MtDecoder_Place(d, field->UPB_PRIVATE(mode) >> kUpb_FieldRep_Shift);
|
613
595
|
}
|
614
596
|
|
615
|
-
|
616
|
-
// actual offsets will overwrite the links of the linked list.
|
617
|
-
for (upb_LayoutItem* item = d->vec.data; item < end; item++) {
|
618
|
-
if (item->type != kUpb_LayoutItemType_OneofCase) continue;
|
619
|
-
upb_MiniTableField* f = &d->fields[item->field_index];
|
620
|
-
while (true) {
|
621
|
-
f->presence = ~item->offset;
|
622
|
-
if (f->UPB_PRIVATE(offset) == kUpb_LayoutItem_IndexSentinel) break;
|
623
|
-
UPB_ASSERT(f->UPB_PRIVATE(offset) - kOneofBase <
|
624
|
-
d->table->UPB_PRIVATE(field_count));
|
625
|
-
f = &d->fields[f->UPB_PRIVATE(offset) - kOneofBase];
|
626
|
-
}
|
627
|
-
}
|
597
|
+
upb_OneOfLayoutItem* oneof_end = UPB_PTRADD(d->oneofs.data, d->oneofs.size);
|
628
598
|
|
629
|
-
|
630
|
-
for (upb_LayoutItem* item = d->vec.data; item < end; item++) {
|
599
|
+
for (upb_OneOfLayoutItem* item = d->oneofs.data; item < oneof_end; item++) {
|
631
600
|
upb_MiniTableField* f = &d->fields[item->field_index];
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
case kUpb_LayoutItemType_Field:
|
642
|
-
f->UPB_PRIVATE(offset) = item->offset;
|
643
|
-
break;
|
644
|
-
default:
|
645
|
-
break;
|
601
|
+
uint16_t case_offset = upb_MtDecoder_Place(d, kUpb_OneOf_CaseFieldRep);
|
602
|
+
uint16_t data_offset = upb_MtDecoder_Place(d, item->rep);
|
603
|
+
while (true) {
|
604
|
+
f->presence = ~case_offset;
|
605
|
+
uint16_t next_offset = f->UPB_PRIVATE(offset);
|
606
|
+
f->UPB_PRIVATE(offset) = data_offset;
|
607
|
+
if (next_offset == kUpb_OneOfLayoutItem_IndexSentinel) break;
|
608
|
+
UPB_ASSERT(next_offset - kOneofBase < d->table->UPB_PRIVATE(field_count));
|
609
|
+
f = &d->fields[next_offset - kOneofBase];
|
646
610
|
}
|
647
611
|
}
|
648
612
|
|
@@ -696,11 +660,8 @@ static void upb_MtDecoder_ParseMap(upb_MtDecoder* d, const char* data,
|
|
696
660
|
UPB_UNREACHABLE();
|
697
661
|
}
|
698
662
|
|
699
|
-
|
700
|
-
|
701
|
-
if (item->type == kUpb_LayoutItemType_OneofCase) {
|
702
|
-
upb_MdDecoder_ErrorJmp(&d->base, "Map entry cannot have oneof");
|
703
|
-
}
|
663
|
+
if (d->oneofs.size != 0) {
|
664
|
+
upb_MdDecoder_ErrorJmp(&d->base, "Map entry cannot have oneof");
|
704
665
|
}
|
705
666
|
|
706
667
|
upb_MtDecoder_ValidateEntryField(d, &d->table->UPB_PRIVATE(fields)[0], 1);
|
@@ -742,7 +703,7 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
|
|
742
703
|
decoder->table->UPB_PRIVATE(dense_below) = 0;
|
743
704
|
decoder->table->UPB_PRIVATE(table_mask) = -1;
|
744
705
|
decoder->table->UPB_PRIVATE(required_count) = 0;
|
745
|
-
#
|
706
|
+
#ifdef UPB_TRACING_ENABLED
|
746
707
|
// MiniTables built from MiniDescriptors will not be able to vend the message
|
747
708
|
// name unless it is explicitly set with upb_MiniTable_SetFullName().
|
748
709
|
decoder->table->UPB_PRIVATE(full_name) = 0;
|
@@ -760,7 +721,7 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
|
|
760
721
|
case kUpb_EncodedVersion_MessageV1:
|
761
722
|
upb_MtDecoder_ParseMessage(decoder, data, len);
|
762
723
|
upb_MtDecoder_AssignHasbits(decoder);
|
763
|
-
|
724
|
+
upb_MtDecoder_CalculateAlignments(decoder);
|
764
725
|
upb_MtDecoder_AssignOffsets(decoder);
|
765
726
|
break;
|
766
727
|
|
@@ -774,8 +735,8 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
|
|
774
735
|
}
|
775
736
|
|
776
737
|
done:
|
777
|
-
*buf = decoder->
|
778
|
-
*buf_size = decoder->
|
738
|
+
*buf = decoder->oneofs.data;
|
739
|
+
*buf_size = decoder->oneofs.buf_capacity_bytes;
|
779
740
|
return decoder->table;
|
780
741
|
}
|
781
742
|
|
@@ -783,8 +744,8 @@ static upb_MiniTable* upb_MtDecoder_BuildMiniTableWithBuf(
|
|
783
744
|
upb_MtDecoder* const decoder, const char* const data, const size_t len,
|
784
745
|
void** const buf, size_t* const buf_size) {
|
785
746
|
if (UPB_SETJMP(decoder->base.err) != 0) {
|
786
|
-
*buf = decoder->
|
787
|
-
*buf_size = decoder->
|
747
|
+
*buf = decoder->oneofs.data;
|
748
|
+
*buf_size = decoder->oneofs.buf_capacity_bytes;
|
788
749
|
return NULL;
|
789
750
|
}
|
790
751
|
|
@@ -800,10 +761,10 @@ upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
|
|
800
761
|
upb_MtDecoder decoder = {
|
801
762
|
.base = {.status = status},
|
802
763
|
.platform = platform,
|
803
|
-
.
|
764
|
+
.oneofs =
|
804
765
|
{
|
805
766
|
.data = *buf,
|
806
|
-
.
|
767
|
+
.buf_capacity_bytes = *buf_size,
|
807
768
|
.size = 0,
|
808
769
|
},
|
809
770
|
.arena = arena,
|
@@ -901,6 +862,6 @@ upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
|
|
901
862
|
size_t size = 0;
|
902
863
|
upb_MiniTable* ret = upb_MiniTable_BuildWithBuf(data, len, platform, arena,
|
903
864
|
&buf, &size, status);
|
904
|
-
|
865
|
+
upb_gfree(buf);
|
905
866
|
return ret;
|
906
867
|
}
|